Search Results for

    Show / Hide Table of Contents

    Class NuGetVersionManager

    Inheritance
    object
    NuGetVersionManager
    Implements
    INuGetVersionManager
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.NuGetManager.Versioning
    Assembly: LemonEdge.NuGetManager.dll
    Syntax
    public class NuGetVersionManager : INuGetVersionManager

    Constructors

    NuGetVersionManager(ILogger<NuGetVersionManager>)

    Declaration
    public NuGetVersionManager(ILogger<NuGetVersionManager> logger)
    Parameters
    Type Name Description
    ILogger<NuGetVersionManager> logger

    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
    public 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
    public 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

    Implements

    INuGetVersionManager

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.