Class PackageIdentity
Represents the core identity of a nupkg.
public class PackageIdentity : IEquatable<PackageIdentity>, IComparable<PackageIdentity>
- Inheritance
-
PackageIdentity
- Implements
- Derived
- Inherited Members
Constructors
PackageIdentity(string, NuGetVersion)
Creates a new package identity.
public PackageIdentity(string id, NuGetVersion version)
Parameters
id
stringname
version
NuGetVersionversion
Properties
Comparer
An equality comparer that checks the id, version, and version release label.
public static PackageIdentityComparer Comparer { get; }
Property Value
HasVersion
True if the version is non-null
public bool HasVersion { get; }
Property Value
Id
Package name
public string Id { get; }
Property Value
Version
Package Version
public NuGetVersion Version { get; }
Property Value
- NuGetVersion
Remarks
can be null
Methods
CompareTo(PackageIdentity)
Sorts based on the id, then version
public int CompareTo(PackageIdentity other)
Parameters
other
PackageIdentity
Returns
Equals(PackageIdentity)
True if the package identities are the same.
public bool Equals(PackageIdentity other)
Parameters
other
PackageIdentity
Returns
Equals(PackageIdentity, VersionComparison)
True if the identity objects are equal based on the given comparison mode.
public virtual bool Equals(PackageIdentity other, VersionComparison versionComparison)
Parameters
other
PackageIdentityversionComparison
VersionComparison
Returns
Equals(object)
Compare using the default comparer.
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
Creates a hash code using the default comparer.
public override int GetHashCode()
Returns
ToString()
PackageIdentity.ToString returns packageId.packageVersion"
public override string ToString()