Class InventoryExtensions
Inheritance
Inherited Members
Namespace: Mediachase.Commerce.InventoryService
Assembly: Mediachase.Commerce.dll
Version: 10.8.0Syntax
public static class InventoryExtensions
Methods
Adjust(IInventoryService, InventoryChange)
Calls Adjust(IEnumerable<InventoryChange>) with a single InventoryChange.
Declaration
public static void Adjust(this IInventoryService service, InventoryChange change)
Parameters
Type | Name | Description |
---|---|---|
IInventoryService | service | The service to call. |
InventoryChange | change | The change to apply. |
Delete(IInventoryService, InventoryKey)
Calls Delete(IEnumerable<InventoryKey>) for a single InventoryKey.
Declaration
public static void Delete(this IInventoryService service, InventoryKey inventoryKey)
Parameters
Type | Name | Description |
---|---|---|
IInventoryService | service | The service to call. |
InventoryKey | inventoryKey | The key of the inventory record to delete. |
DeleteByEntry(IInventoryService, String)
Calls DeleteByEntry(IEnumerable<String>) for a single catalog entry code.
Declaration
public static void DeleteByEntry(this IInventoryService service, string catalogEntryCode)
Parameters
Type | Name | Description |
---|---|---|
IInventoryService | service | The service to call. |
System.String | catalogEntryCode | The entry to delete all inventory for. |
DeleteByWarehouse(IInventoryService, String)
Calls DeleteByWarehouse(IEnumerable<String>) for a single warehouse code.
Declaration
public static void DeleteByWarehouse(this IInventoryService service, string warehouseCode)
Parameters
Type | Name | Description |
---|---|---|
IInventoryService | service | The service to call. |
System.String | warehouseCode | The warehouse to delete all inventory for. |
GetEntryTotals(IEnumerable<InventoryRecord>)
Groups the elements in source
by catalog entry code, and aggregates
the inventory values for each group into a single InventoryRecord.
Declaration
public static IList<InventoryRecord> GetEntryTotals(this IEnumerable<InventoryRecord> source)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<InventoryRecord> | source | The collection of InventoryRecord instances. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<InventoryRecord> | A collection one InventoryRecord instance for each distinct catalog entry code, representing an aggregate inventory across all specified records. |
Remarks
All dates and the ReorderMinQuantity property are aggregated to the minimum represented value. Other quantities are summed.
If any value in a group has a IsTracked value of false, then the record representing the group will have IsTracked set to false, PurchaseAvailableQuantity set to the maximum possible value, and BackorderAvailableQuantity set to zero. If the dates for the records indicate that preordering is available, then PreorderAvailableQuantity will be set to the maximum possible value; otherwise, it will be set to zero.