Example #1
0
        }// 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();
        }
Example #2
0
        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 /////////////////////
Example #3
0
 public void Remove(IInventoryItemEntryCommand c)
 {
     _innerCommands.Remove(c);
 }
Example #4
0
 public void Add(IInventoryItemEntryCommand c)
 {
     _innerCommands.Add(c);
 }
Example #5
0
 void IInventoryItemEntryCommands.Remove(IInventoryItemEntryCommand c)
 {
     _innerCommands.Remove((CreateOrMergePatchOrRemoveInventoryItemEntryDto)c);
 }