Interface IInventoryService
Manages warehouse information and inventory levels.
Namespace: Mediachase.Commerce.InventoryService
Assembly: Mediachase.Commerce.dll
Version: 12.17.2Syntax
public interface IInventoryService
Methods
Adjust(IEnumerable<InventoryChange>)
Incrments or decrements matching values in the inventory provider. Elements of
changes are matched to existing data by item and warehouse code,
and each quantity in the InventoryChange is added to the
corresponding quantity in the inventory provider.
Declaration
void Adjust(IEnumerable<InventoryChange> changes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<InventoryChange> | changes | The changes to apply. |
Delete(IEnumerable<InventoryKey>)
Deletes all specified inventory data.
Declaration
void Delete(IEnumerable<InventoryKey> inventoryKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<InventoryKey> | inventoryKeys | The inventory data to delete. |
DeleteByEntry(IEnumerable<String>)
Deletes all inventory data for the specified catalog entries.
Declaration
void DeleteByEntry(IEnumerable<string> catalogEntryCodes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | catalogEntryCodes | The catalog entry codes to match. |
DeleteByWarehouse(IEnumerable<String>)
Deletes all inventory data for the specified warehouses.
Declaration
void DeleteByWarehouse(IEnumerable<string> warehouseCode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | warehouseCode | The warehouse codes to match. |
Get(String, String)
Gets a single inventory record for a catalog entry and a warehouse, or null if a record does not exist.
Declaration
InventoryRecord Get(string catalogEntryCode, string warehouseCode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | catalogEntryCode | The code of the desired catalog entry. |
| System.String | warehouseCode | The code of the desired warehouse. |
Returns
| Type | Description |
|---|---|
| InventoryRecord | The matching InventoryRecord, or null if not found. |
GetCacheSkippingInstance()
Gets an instance of IInventoryService that will skip the cache on reads. Writes to the instance will still invalidate cache entries.
Declaration
IInventoryService GetCacheSkippingInstance()
Returns
| Type | Description |
|---|---|
| IInventoryService | An instance of IInventoryService that will skip the cache on reads. |
Insert(IEnumerable<InventoryRecord>)
Inserts the specified inventory records. An exception will be thrown if any records exist with matching InventoryRecord.CatalogEntryCode and InventoryRecord.WarehouseCode values.
Declaration
void Insert(IEnumerable<InventoryRecord> records)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<InventoryRecord> | records | The records to insert. |
List()
Lists all inventory records.
Declaration
IList<InventoryRecord> List()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<InventoryRecord> | A list of all InventoryRecord values. |
QueryByEntry(IEnumerable<String>)
Lists all inventory records matching catalogEntryCodes.
Declaration
IList<InventoryRecord> QueryByEntry(IEnumerable<string> catalogEntryCodes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | catalogEntryCodes | The codes of the desired catalog entries. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<InventoryRecord> | A list of all matching InventoryRecord. |
QueryByEntry(IEnumerable<String>, Int32, Int32, out Int32)
Lists all inventory records matching catalogEntryCodes, ordered by
the entry and warehouse codes, with paging.
Declaration
IList<InventoryRecord> QueryByEntry(IEnumerable<string> catalogEntryCodes, int offset, int count, out int totalCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | catalogEntryCodes | The codes of the desired catalog entries. |
| System.Int32 | offset | The number of records to skip. |
| System.Int32 | count | The maximum number of records to return. |
| System.Int32 | totalCount | The total number of matching records. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<InventoryRecord> | A list of all matching InventoryRecords in the specified range. |
QueryByPartialKey(IEnumerable<InventoryKey>)
Lists all inventory records matching an item in partialKeys. The values
of CatalogEntryCode and/or
WarehouseCode may be null to match any value.
Declaration
IList<InventoryRecord> QueryByPartialKey(IEnumerable<InventoryKey> partialKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<InventoryKey> | partialKeys | The keys to match. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<InventoryRecord> | A list of all matching InventoryRecords. |
Remarks
This method exists to support implementations of the Request method. Note that only specifically null values will act as wildcards; empty or white space strings will not be treated as a wildcard.
QueryByPartialKey(IEnumerable<InventoryKey>, Int32, Int32, out Int32)
Lists all inventory records matching an item in partialKeys, ordered
by the entry and warehouse codes, with paging. The values of
CatalogEntryCode and/or
WarehouseCode may be null to match any value.
Declaration
IList<InventoryRecord> QueryByPartialKey(IEnumerable<InventoryKey> partialKeys, int offset, int count, out int totalCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<InventoryKey> | partialKeys | The keys to match. |
| System.Int32 | offset | The number of records to skip. |
| System.Int32 | count | The maximum number of records to return. |
| System.Int32 | totalCount | The total number of matching records. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<InventoryRecord> | A list of all matching InventoryRecords in the specified range. |
Remarks
This method exists to support implementations of the Request method. Note that only specifically null values will act as wildcards; empty or white space strings will not be treated as a wildcard.
QueryByWarehouse(IEnumerable<String>)
Lists all inventory records matching warehouseCodes.
Declaration
IList<InventoryRecord> QueryByWarehouse(IEnumerable<string> warehouseCodes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | warehouseCodes | The IDs of the desired warehouses. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<InventoryRecord> | A list of all matching InventoryRecords. |
QueryByWarehouse(IEnumerable<String>, Int32, Int32, out Int32)
Lists all inventory records matching warehouseCodes, ordered by the
entry and warehouse codes, with paging.
Declaration
IList<InventoryRecord> QueryByWarehouse(IEnumerable<string> warehouseCodes, int offset, int count, out int totalCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | warehouseCodes | The codes of the desired warehouses. |
| System.Int32 | offset | The number of records to skip. |
| System.Int32 | count | The maximum number of records to return. |
| System.Int32 | totalCount | The total number of matching records. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<InventoryRecord> | A list of all matching InventoryRecords in the specified range. |
Request(InventoryRequest)
Requests a transactional inventory operation.
Declaration
InventoryResponse Request(InventoryRequest request)
Parameters
| Type | Name | Description |
|---|---|---|
| InventoryRequest | request | The request. |
Returns
| Type | Description |
|---|---|
| InventoryResponse | The result of the request. |
Save(IEnumerable<InventoryRecord>)
Saves the specified inventory records. Records will be matched to existing records on InventoryRecord.CatalogEntryCode and InventoryRecord.WarehouseCode values; and will be updated when a match is found and inserted when a match is not found.
Declaration
void Save(IEnumerable<InventoryRecord> records)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<InventoryRecord> | records | The records to save. |
Update(IEnumerable<InventoryRecord>)
Updates the specified records. Records will be matched to existing records on InventoryRecord.CatalogEntryCode and InventoryRecord.WarehouseCode values; and an exception will be thrown for any records that do not match.
Declaration
void Update(IEnumerable<InventoryRecord> records)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<InventoryRecord> | records |