Example #1
0
        protected void ThrowOnInconsistentCommands(IAttributeSetCommand command, IAttributeUseCommand innerCommand)
        {
            var properties      = command as ICreateOrMergePatchOrDeleteAttributeSet;
            var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveAttributeUse;

            if (properties == null || innerProperties == null)
            {
                return;
            }
            var outerAttributeSetIdName  = "AttributeSetId";
            var outerAttributeSetIdValue = properties.AttributeSetId;
            var innerAttributeSetIdName  = "AttributeSetId";
            var innerAttributeSetIdValue = innerProperties.AttributeSetId;

            SetNullInnerIdOrThrowOnInconsistentIds(innerProperties, innerAttributeSetIdName, innerAttributeSetIdValue, outerAttributeSetIdName, outerAttributeSetIdValue);
        }// END ThrowOnInconsistentCommands /////////////////////
Example #2
0
        }// END ThrowOnInconsistentCommands /////////////////////

        protected virtual IAttributeUseStateEvent Map(IAttributeUseCommand c, IAttributeSetCommand outerCommand, long version, IAttributeSetState outerState)
        {
            var create = (c.CommandType == CommandType.Create) ? (c as ICreateAttributeUse) : null;

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

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

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

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

            if (remove != null)
            {
                return(MapRemove(remove, outerCommand, version));
            }
            throw new NotSupportedException();
        }
Example #3
0
 void IAttributeUseCommands.Remove(IAttributeUseCommand c)
 {
     _innerCommands.Remove((CreateOrMergePatchOrRemoveAttributeUseDto)c);
 }
Example #4
0
 public void Remove(IAttributeUseCommand c)
 {
     _innerCommands.Remove(c);
 }
Example #5
0
 public void Add(IAttributeUseCommand c)
 {
     _innerCommands.Add(c);
 }