protected void ThrowOnInconsistentCommands(IAttributeCommand command, IAttributeValueCommand innerCommand) { var properties = command as ICreateOrMergePatchOrDeleteAttribute; var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveAttributeValue; if (properties == null || innerProperties == null) { return; } var outerAttributeIdName = "AttributeId"; var outerAttributeIdValue = properties.AttributeId; var innerAttributeIdName = "AttributeId"; var innerAttributeIdValue = innerProperties.AttributeId; SetNullInnerIdOrThrowOnInconsistentIds(innerProperties, innerAttributeIdName, innerAttributeIdValue, outerAttributeIdName, outerAttributeIdValue); }// END ThrowOnInconsistentCommands /////////////////////
}// END ThrowOnInconsistentCommands ///////////////////// protected virtual IAttributeValueStateEvent Map(IAttributeValueCommand c, IAttributeCommand outerCommand, long version, IAttributeState outerState) { var create = (c.CommandType == CommandType.Create) ? (c as ICreateAttributeValue) : null; if (create != null) { return(MapCreate(create, outerCommand, version, outerState)); } var merge = (c.CommandType == CommandType.MergePatch) ? (c as IMergePatchAttributeValue) : null; if (merge != null) { return(MapMergePatch(merge, outerCommand, version, outerState)); } var remove = (c.CommandType == CommandType.Remove) ? (c as IRemoveAttributeValue) : null; if (remove != null) { return(MapRemove(remove, outerCommand, version)); } throw new NotSupportedException(); }
void IAttributeValueCommands.Remove(IAttributeValueCommand c) { _innerCommands.Remove((CreateOrMergePatchOrRemoveAttributeValueDto)c); }
public void Remove(IAttributeValueCommand c) { _innerCommands.Remove(c); }
public void Add(IAttributeValueCommand c) { _innerCommands.Add(c); }