Class MicrosoftUpdatePackageIdentity
Represents the identity of a Microsoft Update package (update)
Inheritance
Namespace: Microsoft.PackageGraph.MicrosoftUpdate.Metadata
Assembly: package-graph-microsoft-update.dll
Syntax
public class MicrosoftUpdatePackageIdentity : IPackageIdentity, IComparable
Constructors
| Improve this Doc View SourceMicrosoftUpdatePackageIdentity(Guid, Int32)
Create an update identity from GUID and revision
Declaration
public MicrosoftUpdatePackageIdentity(Guid id, int revision)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Update GUID |
System.Int32 | revision | Update revision |
Properties
| Improve this Doc View SourceID
Gets the ID part of the identity
Declaration
[JsonProperty]
public Guid ID { get; }
Property Value
Type | Description |
---|---|
System.Guid | GUID identity |
OpenId
A unique ID for a package across all partitions. Implementations of this interface expose a partition specific ID as well.
Declaration
[JsonIgnore]
public byte[] OpenId { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
OpenIdHex
HEX representation of the unique ID.
Declaration
[JsonIgnore]
public string OpenIdHex { get; }
Property Value
Type | Description |
---|---|
System.String |
Partition
The partition to which the update belongs. Possible values are Linux, Microsoft, Nuget, etc.
Declaration
[JsonProperty]
public string Partition { get; }
Property Value
Type | Description |
---|---|
System.String |
Revision
Gets the revision part of the identity
Declaration
[JsonProperty]
public int Revision { get; }
Property Value
Type | Description |
---|---|
System.Int32 | Revision integer |
Methods
| Improve this Doc View SourceCompareTo(Object)
Comparison override.
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The other Identity object |
Returns
Type | Description |
---|---|
System.Int32 | -1 if this instance precedes obj in the sort order 0 if this instance occurs in the same position in the sort order as obj 1 if this instance follows obj in the sort order. |
Equals(Object)
Equals override. Checks that both ID and Revision match
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The other Identity |
Returns
Type | Description |
---|---|
System.Boolean | True if identities are equal, false otherwise |
Overrides
FromString(String)
Create update identity from string representation
Declaration
public static MicrosoftUpdatePackageIdentity FromString(string packageIdentityString)
Parameters
Type | Name | Description |
---|---|---|
System.String | packageIdentityString | Update ID in string form |
Returns
Type | Description |
---|---|
MicrosoftUpdatePackageIdentity | Microsoft update package identity |
Exceptions
Type | Condition |
---|---|
System.FormatException | If the string does not have the required format |
GetHashCode()
Returns a hash code based on both ID and Revision.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code |
Overrides
ToString()
Returns a string representation of the Identity, based on ID and Revision
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | Identity string |
Overrides
Operators
| Improve this Doc View SourceEquality(MicrosoftUpdatePackageIdentity, MicrosoftUpdatePackageIdentity)
Equality operator override. Matches Equals return value;
Declaration
public static bool operator ==(MicrosoftUpdatePackageIdentity lhs, MicrosoftUpdatePackageIdentity rhs)
Parameters
Type | Name | Description |
---|---|---|
MicrosoftUpdatePackageIdentity | lhs | |
MicrosoftUpdatePackageIdentity | rhs |
Returns
Type | Description |
---|---|
System.Boolean | True if the two Identity objects are equal, false otherwise |
Inequality(MicrosoftUpdatePackageIdentity, MicrosoftUpdatePackageIdentity)
Inequality operator override. The reverse of Equals.
Declaration
public static bool operator !=(MicrosoftUpdatePackageIdentity lhs, MicrosoftUpdatePackageIdentity rhs)
Parameters
Type | Name | Description |
---|---|---|
MicrosoftUpdatePackageIdentity | lhs | Left Identity |
MicrosoftUpdatePackageIdentity | rhs | Right Identity |
Returns
Type | Description |
---|---|
System.Boolean | True if the two Identity objects are not equal, false otherwise. |