Exemplo n.º 1
0
        protected void ThrowOnInconsistentCommands(IPicklistCommand command, IPicklistRoleCommand innerCommand)
        {
            var properties      = command as ICreateOrMergePatchOrDeletePicklist;
            var innerProperties = innerCommand as ICreateOrMergePatchOrRemovePicklistRole;

            if (properties == null || innerProperties == null)
            {
                return;
            }
            if (innerProperties.PicklistId == default(string))
            {
                innerProperties.PicklistId = properties.PicklistId;
            }
            else
            {
                var outerPicklistIdName  = "PicklistId";
                var outerPicklistIdValue = properties.PicklistId;
                var innerPicklistIdName  = "PicklistId";
                var innerPicklistIdValue = innerProperties.PicklistId;
                ThrowOnInconsistentIds(innerProperties, innerPicklistIdName, innerPicklistIdValue, outerPicklistIdName, outerPicklistIdValue);
            }
        }// END ThrowOnInconsistentCommands /////////////////////
Exemplo n.º 2
0
        }// END ThrowOnInconsistentCommands /////////////////////

        protected virtual IPicklistRoleEvent Map(IPicklistRoleCommand c, IPicklistCommand outerCommand, long version, IPicklistState outerState)
        {
            var create = (c.CommandType == CommandType.Create) ? (c as ICreatePicklistRole) : null;

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

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

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

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

            if (remove != null)
            {
                return(MapRemove(remove, outerCommand, version));
            }
            throw new NotSupportedException();
        }
Exemplo n.º 3
0
 void IPicklistRoleCommands.Remove(IPicklistRoleCommand c)
 {
     _innerCommands.Remove((CreateOrMergePatchOrRemovePicklistRoleDto)c);
 }
Exemplo n.º 4
0
 public void Remove(IPicklistRoleCommand c)
 {
     _innerCommands.Remove(c);
 }
Exemplo n.º 5
0
 public void Add(IPicklistRoleCommand c)
 {
     _innerCommands.Add(c);
 }