Class PrimaryKeyId
Represent primary key id value.
Inheritance
Implements
Namespace: Mediachase.BusinessFoundation.Data
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 14.26.0Syntax
public sealed class PrimaryKeyId : ValueType, IConvertible, IComparable, IComparable<PrimaryKeyId>, IEquatable<PrimaryKeyId>
Constructors
PrimaryKeyId(Guid)
Initializes a new instance of the PrimaryKeyId struct.
Declaration
public PrimaryKeyId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | The uid. |
PrimaryKeyId(Int32)
Initializes a new instance of the PrimaryKeyId struct.
Declaration
public PrimaryKeyId(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The id. |
Fields
Empty
Defines empty primary key.
Declaration
public static readonly PrimaryKeyId Empty
Field Value
Type | Description |
---|---|
PrimaryKeyId |
Properties
InnerType
Gets the type of the inner.
Declaration
public PrimaryKeyIdValueType InnerType { get; }
Property Value
Type | Description |
---|---|
PrimaryKeyIdValueType | The type of the inner. |
Methods
CompareTo(PrimaryKeyId)
Compares the current object with another object of the same type.
Declaration
public int CompareTo(PrimaryKeyId other)
Parameters
Type | Name | Description |
---|---|---|
PrimaryKeyId | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the |
CompareTo(Object)
Compares the current instance with another object of the same type.
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | An object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
Equals(PrimaryKeyId)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(PrimaryKeyId other)
Parameters
Type | Name | Description |
---|---|---|
PrimaryKeyId | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current object is equal to the |
Equals(Object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Another object to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | true if obj and this instance are the same type and represent the same value; otherwise, false. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer that is the hash code for this instance. |
Parse(String)
Parses the specified string.
Declaration
public static PrimaryKeyId Parse(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | A string containing a primary key value time to convert. |
Returns
Type | Description |
---|---|
PrimaryKeyId |
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String containing a fully qualified type name. |
TryParse(String, out PrimaryKeyId)
Tries the parse.
Declaration
public static bool TryParse(string s, out PrimaryKeyId result)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | A string containing a primary key value time to convert. |
PrimaryKeyId | result | The primary key value. |
Returns
Type | Description |
---|---|
System.Boolean |
Operators
Equality(PrimaryKeyId, PrimaryKeyId)
Implements the operator ==.
Declaration
public static bool operator ==(PrimaryKeyId left, PrimaryKeyId right)
Parameters
Type | Name | Description |
---|---|---|
PrimaryKeyId | left | The left. |
PrimaryKeyId | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
Explicit(Guid to PrimaryKeyId)
Performs an explicit conversion from System.Guid to PrimaryKeyId.
Declaration
public static explicit operator PrimaryKeyId(Guid value)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | value | The value. |
Returns
Type | Description |
---|---|
PrimaryKeyId | The result of the conversion. |
Implicit(PrimaryKeyId to Guid)
Performs an implicit conversion from PrimaryKeyId to System.Guid.
Declaration
public static implicit operator Guid(PrimaryKeyId value)
Parameters
Type | Name | Description |
---|---|---|
PrimaryKeyId | value | The value. |
Returns
Type | Description |
---|---|
System.Guid | The result of the conversion. |
Implicit(PrimaryKeyId to Int32)
Performs an implicit conversion from PrimaryKeyId to System.Int32.
Declaration
public static implicit operator int (PrimaryKeyId value)
Parameters
Type | Name | Description |
---|---|---|
PrimaryKeyId | value | The value. |
Returns
Type | Description |
---|---|
System.Int32 | The result of the conversion. |
Implicit(Int32 to PrimaryKeyId)
Performs an implicit conversion from System.Int32 to PrimaryKeyId.
Declaration
public static implicit operator PrimaryKeyId(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
PrimaryKeyId | The result of the conversion. |
Inequality(PrimaryKeyId, PrimaryKeyId)
Implements the operator !=.
Declaration
public static bool operator !=(PrimaryKeyId left, PrimaryKeyId right)
Parameters
Type | Name | Description |
---|---|---|
PrimaryKeyId | left | The left. |
PrimaryKeyId | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |