SaaS CMS has officially launched! Learn more now.

Class RecordStateSet

A collection of RecordState for a request, with methods to work within the request processing flow.

Inheritance
System.Object
RecordStateSet
Implements
System.Collections.Generic.IEnumerable<RecordState>
System.Collections.IEnumerable
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.BusinessLogic
Assembly: Mediachase.Commerce.dll
Version: 11.8.3
Syntax
public class RecordStateSet : IEnumerable<RecordState>, IEnumerable

Constructors

RecordStateSet()

Creates a new instance of RecordStateSet.

Declaration
public RecordStateSet()

Properties

Item[InventoryKey]

Gets an InventoryKey for the specified InventoryKey.

Declaration
public RecordState this[InventoryKey key] { get; }
Parameters
Type Name Description
InventoryKey key

The InventoryKey to get a record state for.

Property Value
Type Description
RecordState

The RecordState matching key. If not found, an exception will be thrown.

Methods

GetEntryRecords(String)

Gets all RecordState instances matching catalogEntryCode.

Declaration
public IList<RecordState> GetEntryRecords(string catalogEntryCode)
Parameters
Type Name Description
System.String catalogEntryCode

The catalog entry code to match.

Returns
Type Description
System.Collections.Generic.IList<RecordState>

All loaded RecordState instances matching catalogEntryCode.

Remarks

Custom processors supporting decisions between mutiple warehouses should use GetEntryRecords(String) instead of TryGetRecord(String, String, out RecordState) to fetch record states.

GetEnumerator()

Enumerates all RecordState instances in the RecordStateSet.

Declaration
public IEnumerator<RecordState> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<RecordState>

IncludeRecordsFor(String, String)

Notifies the RecordStateSet that the processor will access the inventory record with the specified catalog entry code and warehouse code; or all inventory records with the specified catalog entry code, if warehouseCode is null or empty.

Declaration
public void IncludeRecordsFor(string catalogEntryCode, string warehouseCode)
Parameters
Type Name Description
System.String catalogEntryCode

The catalog entry code to match.

System.String warehouseCode

The warehouse code to match, or null or empty to match any warehouse.

Remarks

This method is intended to be called from the constructors of classes extending RequestItemProcessor, and will determine what records are retrieved by LoadRequestedRecords(IInventoryService). Once LoadRequestedRecords(IInventoryService) has been called, IncludeRecordsFor(String, String) will have no effect.

LoadRequestedRecords(IInventoryService)

Loads the records requested by IncludeRecordsFor(String, String).

Declaration
public void LoadRequestedRecords(IInventoryService inventoryService)
Parameters
Type Name Description
IInventoryService inventoryService

The inventory service to load records from.

Remarks

Called by the RequestProcessor after all RequestItemProcessor instances have been created.

TryGetRecord(String, String, out RecordState)

Attempts to get a single RecordState matching a catalog entry and warehouse code, or just a catalog entry if warehouseCode is null or empty.

Declaration
public InventoryResponseType TryGetRecord(string catalogEntryCode, string warehouseCode, out RecordState record)
Parameters
Type Name Description
System.String catalogEntryCode

The catalog entry code to get records for.

System.String warehouseCode

The warehouse code to get records for, or null or empty to get records for any warehouse.

RecordState record

An out parameter that will be set to the matching record on success.

Returns
Type Description
InventoryResponseType

Success on success, ItemNotFound if no matching records are found, or AmbiguousWarehouse if warehouseCode is null or empty and multiple records exist matching catalogEntryCode.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable