public virtual IShipmentMethodTypeState ToShipmentMethodTypeState()
        {
            var state = new ShipmentMethodTypeState(true);

            state.ShipmentMethodTypeId = this.ShipmentMethodTypeId;
            state.Description          = this.Description;
            state.SequenceNum          = this.SequenceNum;
            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(IShipmentMethodTypeStateCreated stateCreated)
        {
            var aggregateId = stateCreated.ShipmentMethodTypeEventId.ShipmentMethodTypeId;
            var state       = new ShipmentMethodTypeState();

            state.ShipmentMethodTypeId = aggregateId;
            var aggregate = (ShipmentMethodTypeAggregate)GetShipmentMethodTypeAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
示例#3
0
 public static CreateShipmentMethodType ToCreateShipmentMethodType(this ShipmentMethodTypeState state)
 {
     return(state.ToCreateShipmentMethodType <CreateShipmentMethodType>());
 }
示例#4
0
 public static MergePatchShipmentMethodType ToMergePatchShipmentMethodType(this ShipmentMethodTypeState state)
 {
     return(state.ToMergePatchShipmentMethodType <MergePatchShipmentMethodType>());
 }
示例#5
0
 public static DeleteShipmentMethodType ToDeleteShipmentMethodType(this ShipmentMethodTypeState state)
 {
     return(state.ToDeleteShipmentMethodType <DeleteShipmentMethodType>());
 }
示例#6
0
 public static IShipmentMethodTypeCommand ToCreateOrMergePatchShipmentMethodType(this ShipmentMethodTypeState state)
 {
     return(state.ToCreateOrMergePatchShipmentMethodType <CreateShipmentMethodType, MergePatchShipmentMethodType>());
 }