}// END ThrowOnInconsistentCommands ///////////////////// protected void ThrowOnInconsistentCommands(IShipmentReceiptCommand command, IShipmentReceiptImageCommand innerCommand) { var properties = command as ICreateOrMergePatchOrRemoveShipmentReceipt; var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveShipmentReceiptImage; if (properties == null || innerProperties == null) { return; } if (innerProperties.ShipmentId == default(string)) { innerProperties.ShipmentId = properties.ShipmentId; } else { var outerShipmentIdName = "ShipmentId"; var outerShipmentIdValue = properties.ShipmentId; var innerShipmentIdName = "ShipmentId"; var innerShipmentIdValue = innerProperties.ShipmentId; ThrowOnInconsistentIds(innerProperties, innerShipmentIdName, innerShipmentIdValue, outerShipmentIdName, outerShipmentIdValue); } if (innerProperties.ShipmentReceiptReceiptSeqId == default(string)) { innerProperties.ShipmentReceiptReceiptSeqId = properties.ReceiptSeqId; } else { var outerReceiptSeqIdName = "ReceiptSeqId"; var outerReceiptSeqIdValue = properties.ReceiptSeqId; var innerShipmentReceiptReceiptSeqIdName = "ShipmentReceiptReceiptSeqId"; var innerShipmentReceiptReceiptSeqIdValue = innerProperties.ShipmentReceiptReceiptSeqId; ThrowOnInconsistentIds(innerProperties, innerShipmentReceiptReceiptSeqIdName, innerShipmentReceiptReceiptSeqIdValue, outerReceiptSeqIdName, outerReceiptSeqIdValue); } }// END ThrowOnInconsistentCommands /////////////////////
}// END Map(IMergePatch... //////////////////////////// protected virtual IShipmentReceiptImageEvent Map(IShipmentReceiptImageCommand c, IShipmentReceiptCommand outerCommand, long version, IShipmentReceiptState outerState) { var create = (c.CommandType == CommandType.Create) ? (c as ICreateShipmentReceiptImage) : null; if (create != null) { return(MapCreate(create, outerCommand, version, outerState)); } var merge = (c.CommandType == CommandType.MergePatch || c.CommandType == null) ? (c as IMergePatchShipmentReceiptImage) : null; if (merge != null) { return(MapMergePatch(merge, outerCommand, version, outerState)); } var remove = (c.CommandType == CommandType.Remove) ? (c as IRemoveShipmentReceiptImage) : null; if (remove != null) { return(MapRemove(remove, outerCommand, version)); } throw new NotSupportedException(); }
public void Remove(IShipmentReceiptImageCommand c) { _innerCommands.Remove(c); }
public void Add(IShipmentReceiptImageCommand c) { _innerCommands.Add(c); }
void IShipmentReceiptImageCommands.Remove(IShipmentReceiptImageCommand c) { _innerCommands.Remove((CreateOrMergePatchOrRemoveShipmentReceiptImageDto)c); }