コード例 #1
0
ファイル: AttributeAggregate.cs プロジェクト: uwitec/wms-8
        }// END ThrowOnInconsistentCommands /////////////////////

        protected void ThrowOnInconsistentCommands(IAttributeCommand command, IAttributeAliasCommand innerCommand)
        {
            var properties      = command as ICreateOrMergePatchOrDeleteAttribute;
            var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveAttributeAlias;

            if (properties == null || innerProperties == null)
            {
                return;
            }
            if (innerProperties.AttributeId == default(string))
            {
                innerProperties.AttributeId = properties.AttributeId;
            }
            else
            {
                var outerAttributeIdName  = "AttributeId";
                var outerAttributeIdValue = properties.AttributeId;
                var innerAttributeIdName  = "AttributeId";
                var innerAttributeIdValue = innerProperties.AttributeId;
                ThrowOnInconsistentIds(innerProperties, innerAttributeIdName, innerAttributeIdValue, outerAttributeIdName, outerAttributeIdValue);
            }
        }// END ThrowOnInconsistentCommands /////////////////////
コード例 #2
0
ファイル: AttributeAggregate.cs プロジェクト: uwitec/wms-8
        }// END Map(IRemove... ////////////////////////////

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

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

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

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

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

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