protected void ThrowOnInconsistentCommands(IPicklistBinCommand command, IPicklistItemCommand innerCommand) { var properties = command as ICreateOrMergePatchOrDeletePicklistBin; var innerProperties = innerCommand as ICreateOrMergePatchOrRemovePicklistItem; if (properties == null || innerProperties == null) { return; } if (innerProperties.PicklistBinId == default(string)) { innerProperties.PicklistBinId = properties.PicklistBinId; } else { var outerPicklistBinIdName = "PicklistBinId"; var outerPicklistBinIdValue = properties.PicklistBinId; var innerPicklistBinIdName = "PicklistBinId"; var innerPicklistBinIdValue = innerProperties.PicklistBinId; ThrowOnInconsistentIds(innerProperties, innerPicklistBinIdName, innerPicklistBinIdValue, outerPicklistBinIdName, outerPicklistBinIdValue); } }// END ThrowOnInconsistentCommands /////////////////////
}// END ThrowOnInconsistentCommands ///////////////////// protected virtual IPicklistItemEvent Map(IPicklistItemCommand c, IPicklistBinCommand outerCommand, long version, IPicklistBinState outerState) { var create = (c.CommandType == CommandType.Create) ? (c as ICreatePicklistItem) : null; if (create != null) { return(MapCreate(create, outerCommand, version, outerState)); } var merge = (c.CommandType == CommandType.MergePatch || c.CommandType == null) ? (c as IMergePatchPicklistItem) : null; if (merge != null) { return(MapMergePatch(merge, outerCommand, version, outerState)); } var remove = (c.CommandType == CommandType.Remove) ? (c as IRemovePicklistItem) : null; if (remove != null) { return(MapRemove(remove, outerCommand, version)); } throw new NotSupportedException(); }
public void Remove(IPicklistItemCommand c) { _innerCommands.Remove(c); }
void IPicklistItemCommands.Remove(IPicklistItemCommand c) { _innerCommands.Remove((CreateOrMergePatchOrRemovePicklistItemDto)c); }
public void Add(IPicklistItemCommand c) { _innerCommands.Add(c); }