}// END ThrowOnInconsistentCommands ///////////////////// protected virtual ISellableInventoryItemEntryEvent Map(ISellableInventoryItemEntryCommand c, ISellableInventoryItemCommand outerCommand, long version, ISellableInventoryItemState outerState) { var create = (c.CommandType == CommandType.Create) ? (c as ICreateSellableInventoryItemEntry) : null; if (create != null) { return(MapCreate(create, outerCommand, version, outerState)); } throw new NotSupportedException(); }
protected void ThrowOnInconsistentCommands(ISellableInventoryItemCommand command, ISellableInventoryItemEntryCommand innerCommand) { var properties = command as ICreateOrMergePatchOrDeleteSellableInventoryItem; var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveSellableInventoryItemEntry; if (properties == null || innerProperties == null) { return; } if (innerProperties.SellableInventoryItemId == default(InventoryItemId)) { innerProperties.SellableInventoryItemId = properties.SellableInventoryItemId; } else { var outerSellableInventoryItemIdName = "SellableInventoryItemId"; var outerSellableInventoryItemIdValue = properties.SellableInventoryItemId; var innerSellableInventoryItemIdName = "SellableInventoryItemId"; var innerSellableInventoryItemIdValue = innerProperties.SellableInventoryItemId; ThrowOnInconsistentIds(innerProperties, innerSellableInventoryItemIdName, innerSellableInventoryItemIdValue, outerSellableInventoryItemIdName, outerSellableInventoryItemIdValue); } }// END ThrowOnInconsistentCommands /////////////////////
public void Remove(ISellableInventoryItemEntryCommand c) { _innerCommands.Remove(c); }
void ISellableInventoryItemEntryCommands.Remove(ISellableInventoryItemEntryCommand c) { _innerCommands.Remove((CreateOrMergePatchOrRemoveSellableInventoryItemEntryDto)c); }
public void Add(ISellableInventoryItemEntryCommand c) { _innerCommands.Add(c); }