public virtual IShipmentTypeState ToShipmentTypeState() { var state = new ShipmentTypeState(true); state.ShipmentTypeId = this.ShipmentTypeId; state.ParentTypeId = this.ParentTypeId; state.HasTable = this.HasTable; state.Description = this.Description; if (this.Active != null && this.Active.HasValue) { state.Active = this.Active.Value; } if (this.Version != null && this.Version.HasValue) { state.Version = this.Version.Value; } state.CreatedBy = this.CreatedBy; if (this.CreatedAt != null && this.CreatedAt.HasValue) { state.CreatedAt = this.CreatedAt.Value; } state.UpdatedBy = this.UpdatedBy; if (this.UpdatedAt != null && this.UpdatedAt.HasValue) { state.UpdatedAt = this.UpdatedAt.Value; } return(state); }
public virtual void Initialize(IShipmentTypeStateCreated stateCreated) { var aggregateId = stateCreated.ShipmentTypeEventId.ShipmentTypeId; var state = new ShipmentTypeState(); state.ShipmentTypeId = aggregateId; var aggregate = (ShipmentTypeAggregate)GetShipmentTypeAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public static CreateShipmentType ToCreateShipmentType(this ShipmentTypeState state) { return(state.ToCreateShipmentType <CreateShipmentType>()); }
public static MergePatchShipmentType ToMergePatchShipmentType(this ShipmentTypeState state) { return(state.ToMergePatchShipmentType <MergePatchShipmentType>()); }
public static DeleteShipmentType ToDeleteShipmentType(this ShipmentTypeState state) { return(state.ToDeleteShipmentType <DeleteShipmentType>()); }
public static IShipmentTypeCommand ToCreateOrMergePatchShipmentType(this ShipmentTypeState state) { return(state.ToCreateOrMergePatchShipmentType <CreateShipmentType, MergePatchShipmentType>()); }