November Happy Hour will be moved to Thursday December 5th.

Class InventoryServiceProvider

Inheritance
System.Object
InventoryServiceProvider
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.InventoryService
Assembly: Mediachase.Commerce.dll
Version: 12.17.2
Syntax
public class InventoryServiceProvider : IInventoryService

Constructors

InventoryServiceProvider(RequestProcessorFactory, ISynchronizedObjectInstanceCache)

Creates a new instance of InventoryServiceProvider.

Declaration
public InventoryServiceProvider(RequestProcessorFactory processorFactory, ISynchronizedObjectInstanceCache cache)
Parameters
Type Name Description
RequestProcessorFactory processorFactory

The factory for request processors.

EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache cache

The cache.

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
public virtual 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
public virtual 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
public virtual 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
public virtual void DeleteByWarehouse(IEnumerable<string> warehouseCodes)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> warehouseCodes

Get(String, String)

Gets a single inventory record for a catalog entry and a warehouse, or null if a record does not exist.

Declaration
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public virtual void Update(IEnumerable<InventoryRecord> records)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<InventoryRecord> records

Implements

Extension Methods