Show / Hide Table of Contents

Class MicrosoftUpdatePackageIdentity

Represents the identity of a Microsoft Update package (update)

Inheritance
System.Object
MicrosoftUpdatePackageIdentity
Implements
IPackageIdentity
System.IComparable
Namespace: Microsoft.PackageGraph.MicrosoftUpdate.Metadata
Assembly: package-graph-microsoft-update.dll
Syntax
public class MicrosoftUpdatePackageIdentity : IPackageIdentity, IComparable

Constructors

| Improve this Doc View Source

MicrosoftUpdatePackageIdentity(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 Source

ID

Gets the ID part of the identity

Declaration
[JsonProperty]
public Guid ID { get; }
Property Value
Type Description
System.Guid

GUID identity

| Improve this Doc View Source

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[]
| Improve this Doc View Source

OpenIdHex

HEX representation of the unique ID.

Declaration
[JsonIgnore]
public string OpenIdHex { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

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
| Improve this Doc View Source

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 Source

CompareTo(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.

| Improve this Doc View Source

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
System.Object.Equals(System.Object)
| Improve this Doc View Source

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

| Improve this Doc View Source

GetHashCode()

Returns a hash code based on both ID and Revision.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

Hash code

Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

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
System.Object.ToString()

Operators

| Improve this Doc View Source

Equality(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

| Improve this Doc View Source

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.

Implements

IPackageIdentity
System.IComparable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX