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);
        }
Example #3
0
 public static CreateShipmentMethodType ToCreateShipmentMethodType(this ShipmentMethodTypeState state)
 {
     return(state.ToCreateShipmentMethodType <CreateShipmentMethodType>());
 }
Example #4
0
 public static MergePatchShipmentMethodType ToMergePatchShipmentMethodType(this ShipmentMethodTypeState state)
 {
     return(state.ToMergePatchShipmentMethodType <MergePatchShipmentMethodType>());
 }
Example #5
0
 public static DeleteShipmentMethodType ToDeleteShipmentMethodType(this ShipmentMethodTypeState state)
 {
     return(state.ToDeleteShipmentMethodType <DeleteShipmentMethodType>());
 }
Example #6
0
 public static IShipmentMethodTypeCommand ToCreateOrMergePatchShipmentMethodType(this ShipmentMethodTypeState state)
 {
     return(state.ToCreateOrMergePatchShipmentMethodType <CreateShipmentMethodType, MergePatchShipmentMethodType>());
 }