Interface INuGetVersionManager
Namespace: LemonEdge.NuGetManager.Versioning
Assembly: LemonEdge.NuGetManager.dll
Syntax
public interface INuGetVersionManager
Methods
GetBestMatch(string, IEnumerable<NuGetVersion>, bool)
Returns the best match for a given version string (i.e. , 1.2.3, 2.) from the collection of versions
Declaration
NuGetVersion? GetBestMatch(string versionMatch, IEnumerable<NuGetVersion> versions, bool isPreRelease = false)
Parameters
Type | Name | Description |
---|---|---|
string | versionMatch | The version match string |
IEnumerable<NuGetVersion> | versions | A collection of NuGet.Versioning.NuGetVersion attained from GetVersions(FindPackageByIdResource, string, CancellationToken) |
bool | isPreRelease | Whether to consider pre-release versions |
Returns
Type | Description |
---|---|
NuGetVersion | The best matching NuGet.Versioning.NuGetVersion or null if a match could not be found |
GetVersions(FindPackageByIdResource, string, CancellationToken)
Gets a list of all available versions for a given package name and NuGet.Protocol.Core.Types.FindPackageByIdResource.
Declaration
Task<List<NuGetVersion>> GetVersions(FindPackageByIdResource packageResource, string name, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
FindPackageByIdResource | packageResource | Can be created using GetFindPackageByIdResource(PackageSource, CancellationToken) |
string | name | The package name (i.e. Newtonsoft.Json) |
CancellationToken | token | The cancellation token |
Returns
Type | Description |
---|---|
Task<List<NuGetVersion>> | A collection of NuGet.Versioning.NuGetVersion or an empty collection if no versions were found |