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); }
protected ShipmentPackageStateDeleted NewShipmentPackageStateDeleted(long version, string commandId, string requesterId) { var stateEventId = new ShipmentPackageEventId(_state.ShipmentPackageId, version); var e = NewShipmentPackageStateDeleted(stateEventId); e.CommandId = commandId; e.CreatedBy = (string)requesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
protected virtual IShipmentPackageStateDeleted Map(IDeleteShipmentPackage c) { var stateEventId = new ShipmentPackageEventId(c.ShipmentPackageId, c.Version); IShipmentPackageStateDeleted e = NewShipmentPackageStateDeleted(stateEventId); e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
public override bool Equals(object obj) { if (Object.ReferenceEquals(this, obj)) { return(true); } ShipmentPackageEventId other = obj as ShipmentPackageEventId; if (other == null) { return(false); } return(true && Object.Equals(this.ShipmentPackageId, other.ShipmentPackageId) && Object.Equals(this.Version, other.Version) ); }
protected ShipmentPackageEventBase(ShipmentPackageEventId stateEventId) { this.ShipmentPackageEventId = stateEventId; }
public ShipmentPackageStateDeleted(ShipmentPackageEventId stateEventId) : base(stateEventId) { }
public ShipmentPackageStateMergePatched(ShipmentPackageEventId stateEventId) : base(stateEventId) { }
protected ShipmentPackageStateEventBase(ShipmentPackageEventId stateEventId) : base(stateEventId) { }
private ShipmentPackageStateDeleted NewShipmentPackageStateDeleted(ShipmentPackageEventId stateEventId) { return(new ShipmentPackageStateDeleted(stateEventId)); }
private ShipmentPackageStateMergePatched NewShipmentPackageStateMergePatched(ShipmentPackageEventId stateEventId) { return(new ShipmentPackageStateMergePatched(stateEventId)); }