}// END ThrowOnInconsistentCommands ///////////////////// protected virtual IInventoryItemEntryEvent Map(IInventoryItemEntryCommand c, IInventoryItemCommand outerCommand, long version, IInventoryItemState outerState) { var create = (c.CommandType == CommandType.Create) ? (c as ICreateInventoryItemEntry) : null; if (create != null) { return(MapCreate(create, outerCommand, version, outerState)); } throw new NotSupportedException(); }
protected void ThrowOnInconsistentCommands(IInventoryItemCommand command, IInventoryItemEntryCommand innerCommand) { var properties = command as ICreateOrMergePatchOrDeleteInventoryItem; var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveInventoryItemEntry; if (properties == null || innerProperties == null) { return; } if (innerProperties.InventoryItemId == default(InventoryItemId)) { innerProperties.InventoryItemId = properties.InventoryItemId; } else { var outerInventoryItemIdName = "InventoryItemId"; var outerInventoryItemIdValue = properties.InventoryItemId; var innerInventoryItemIdName = "InventoryItemId"; var innerInventoryItemIdValue = innerProperties.InventoryItemId; ThrowOnInconsistentIds(innerProperties, innerInventoryItemIdName, innerInventoryItemIdValue, outerInventoryItemIdName, outerInventoryItemIdValue); } }// END ThrowOnInconsistentCommands /////////////////////
public void Remove(IInventoryItemEntryCommand c) { _innerCommands.Remove(c); }
public void Add(IInventoryItemEntryCommand c) { _innerCommands.Add(c); }
void IInventoryItemEntryCommands.Remove(IInventoryItemEntryCommand c) { _innerCommands.Remove((CreateOrMergePatchOrRemoveInventoryItemEntryDto)c); }