Example #1
0
        }// END ThrowOnInconsistentCommands /////////////////////

        protected virtual IInventoryItemRequirementEntryEvent Map(IInventoryItemRequirementEntryCommand c, IInventoryItemRequirementCommand outerCommand, long version, IInventoryItemRequirementState outerState)
        {
            var create = (c.CommandType == CommandType.Create) ? (c as ICreateInventoryItemRequirementEntry) : null;

            if (create != null)
            {
                return(MapCreate(create, outerCommand, version, outerState));
            }

            throw new NotSupportedException();
        }
Example #2
0
        protected void ThrowOnInconsistentCommands(IInventoryItemRequirementCommand command, IInventoryItemRequirementEntryCommand innerCommand)
        {
            var properties      = command as ICreateOrMergePatchOrDeleteInventoryItemRequirement;
            var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveInventoryItemRequirementEntry;

            if (properties == null || innerProperties == null)
            {
                return;
            }
            if (innerProperties.InventoryItemRequirementId == default(InventoryItemId))
            {
                innerProperties.InventoryItemRequirementId = properties.InventoryItemRequirementId;
            }
            else
            {
                var outerInventoryItemRequirementIdName  = "InventoryItemRequirementId";
                var outerInventoryItemRequirementIdValue = properties.InventoryItemRequirementId;
                var innerInventoryItemRequirementIdName  = "InventoryItemRequirementId";
                var innerInventoryItemRequirementIdValue = innerProperties.InventoryItemRequirementId;
                ThrowOnInconsistentIds(innerProperties, innerInventoryItemRequirementIdName, innerInventoryItemRequirementIdValue, outerInventoryItemRequirementIdName, outerInventoryItemRequirementIdValue);
            }
        }// END ThrowOnInconsistentCommands /////////////////////
 public void Add(IInventoryItemRequirementEntryCommand c)
 {
     _innerCommands.Add(c);
 }
 public void Remove(IInventoryItemRequirementEntryCommand c)
 {
     _innerCommands.Remove(c);
 }
Example #5
0
 void IInventoryItemRequirementEntryCommands.Remove(IInventoryItemRequirementEntryCommand c)
 {
     _innerCommands.Remove((CreateOrMergePatchOrRemoveInventoryItemRequirementEntryDto)c);
 }