Class InventoryKey
Represents a unique identifier for an inventory record.
Inherited Members
Namespace: Mediachase.Commerce.InventoryService
Assembly: Mediachase.Commerce.dll
Version: 10.8.0Syntax
public class InventoryKey : IReadOnly<InventoryKey>, IReadOnly
Constructors
InventoryKey()
Creates a new instance of InventoryKey with default values.
Declaration
public InventoryKey()
InventoryKey(InventoryKey)
Creates a new instance of InventoryKey as a deep copy of
other
.
Declaration
public InventoryKey(InventoryKey other)
Parameters
Type | Name | Description |
---|---|---|
InventoryKey | other | The InventoryKey to copy. |
InventoryKey(String, String)
Creates a new instance of InventoryKey with the specified values.
Declaration
public InventoryKey(string catalogEntryCode, string warehouseCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | catalogEntryCode | The value for CatalogEntryCode. |
System.String | warehouseCode | The value for WarehouseCode. |
Fields
KeyComparer
The default comparer for instances of InventoryKey. The comparer will use case insensitive comparison for the CatalogEntryCode and WarehouseCode values.
Declaration
public static readonly IEqualityComparer<InventoryKey> KeyComparer
Field Value
Type | Description |
---|---|
System.Collections.Generic.IEqualityComparer<InventoryKey> |
PartialKeyComparer
A comparer for partial instances of InventoryKey. The comparer will use case insensitive comparison for the CatalogEntryCode and WarehouseCode values, and will consider null strings and empty strings to be equal.
Declaration
public static readonly IEqualityComparer<InventoryKey> PartialKeyComparer
Field Value
Type | Description |
---|---|
System.Collections.Generic.IEqualityComparer<InventoryKey> |
Properties
CatalogEntryCode
Gets or sets the catalog entry code.
Declaration
public virtual string CatalogEntryCode { get; set; }
Property Value
Type | Description |
---|---|
System.String |
IsReadOnly
Indicates whether the current object instance is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
WarehouseCode
Gets or sets the warehouse code.
Declaration
public virtual string WarehouseCode { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CreateWritableClone()
Creates a writable copy of the current object.
Declaration
public virtual InventoryKey CreateWritableClone()
Returns
Type | Description |
---|---|
InventoryKey | A writable copy of the current object. |
Remarks
The cloning is a deep-copy.
MakeReadOnly()
Changes the object instance into a read-only object.
Declaration
public virtual void MakeReadOnly()
Remarks
After calling this method, any attempt to change the object instance or any contained object will generate a System.NotSupportedException. I.e. the semantics is "deep read-only". Note! After setting an object to read-only it is not possible to revert back to read-write mode. You will have to call the CreateWritableClone method to get a copy that can be modified.
SetAllProperties(Boolean, String, String)
Declaration
protected virtual void SetAllProperties(bool isReadOnly, string catalogEntryCode, string warehouseCode)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isReadOnly | |
System.String | catalogEntryCode | |
System.String | warehouseCode |
ThrowIfReadOnly()
Throws an exception if the instance is read only.
Declaration
protected void ThrowIfReadOnly()