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 /////////////////////
}// 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(); }
void IAttributeUseCommands.Remove(IAttributeUseCommand c) { _innerCommands.Remove((CreateOrMergePatchOrRemoveAttributeUseDto)c); }
public void Remove(IAttributeUseCommand c) { _innerCommands.Remove(c); }
public void Add(IAttributeUseCommand c) { _innerCommands.Add(c); }