protected virtual IShipmentPackageStateCreated Map(ICreateShipmentPackage c) { var stateEventId = new ShipmentPackageEventId(c.ShipmentPackageId, c.Version); IShipmentPackageStateCreated e = NewShipmentPackageStateCreated(stateEventId); e.ShipmentBoxTypeId = c.ShipmentBoxTypeId; e.DateCreated = c.DateCreated; e.BoxLength = c.BoxLength; e.BoxHeight = c.BoxHeight; e.BoxWidth = c.BoxWidth; e.DimensionUomId = c.DimensionUomId; e.Weight = c.Weight; e.WeightUomId = c.WeightUomId; e.InsuredValue = c.InsuredValue; e.Active = c.Active; e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var version = c.Version; foreach (ICreateShipmentPackageContent innerCommand in c.ShipmentPackageContents) { ThrowOnInconsistentCommands(c, innerCommand); IShipmentPackageContentStateCreated innerEvent = MapCreate(innerCommand, c, version, _state); e.AddShipmentPackageContentEvent(innerEvent); } return(e); }
void IShipmentPackageApplicationService.When(ICreateShipmentPackage c) { this.When((CreateShipmentPackageDto)c); }
public virtual void When(ICreateShipmentPackage c) { Update(c, ar => ar.Create(c)); }
public virtual void Create(ICreateShipmentPackage c) { IShipmentPackageStateCreated e = Map(c); Apply(e); }