コード例 #1
0
        protected void ThrowOnInconsistentCommands(IAttributeCommand command, IAttributeValueCommand innerCommand)
        {
            var properties      = command as ICreateOrMergePatchOrDeleteAttribute;
            var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveAttributeValue;

            if (properties == null || innerProperties == null)
            {
                return;
            }
            var outerAttributeIdName  = "AttributeId";
            var outerAttributeIdValue = properties.AttributeId;
            var innerAttributeIdName  = "AttributeId";
            var innerAttributeIdValue = innerProperties.AttributeId;

            SetNullInnerIdOrThrowOnInconsistentIds(innerProperties, innerAttributeIdName, innerAttributeIdValue, outerAttributeIdName, outerAttributeIdValue);
        }// END ThrowOnInconsistentCommands /////////////////////
コード例 #2
0
        }// END ThrowOnInconsistentCommands /////////////////////

        protected virtual IAttributeValueStateEvent Map(IAttributeValueCommand c, IAttributeCommand outerCommand, long version, IAttributeState outerState)
        {
            var create = (c.CommandType == CommandType.Create) ? (c as ICreateAttributeValue) : null;

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

            var merge = (c.CommandType == CommandType.MergePatch) ? (c as IMergePatchAttributeValue) : null;

            if (merge != null)
            {
                return(MapMergePatch(merge, outerCommand, version, outerState));
            }

            var remove = (c.CommandType == CommandType.Remove) ? (c as IRemoveAttributeValue) : null;

            if (remove != null)
            {
                return(MapRemove(remove, outerCommand, version));
            }
            throw new NotSupportedException();
        }
コード例 #3
0
 void IAttributeValueCommands.Remove(IAttributeValueCommand c)
 {
     _innerCommands.Remove((CreateOrMergePatchOrRemoveAttributeValueDto)c);
 }
コード例 #4
0
 public void Remove(IAttributeValueCommand c)
 {
     _innerCommands.Remove(c);
 }
コード例 #5
0
 public void Add(IAttributeValueCommand c)
 {
     _innerCommands.Add(c);
 }