Пример #1
0
        public virtual IInventoryPRTriggeredState ToInventoryPRTriggeredState()
        {
            var state = new InventoryPRTriggeredState(true);

            state.InventoryPRTriggeredId = this.InventoryPRTriggeredId;
            if (this.IsProcessed != null && this.IsProcessed.HasValue)
            {
                state.IsProcessed = this.IsProcessed.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(IInventoryPRTriggeredStateCreated stateCreated)
        {
            var aggregateId = stateCreated.InventoryPRTriggeredEventId.InventoryPRTriggeredId;
            var state       = new InventoryPRTriggeredState();

            state.InventoryPRTriggeredId = aggregateId;
            var aggregate = (InventoryPRTriggeredAggregate)GetInventoryPRTriggeredAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
Пример #3
0
 public static CreateInventoryPRTriggered ToCreateInventoryPRTriggered(this InventoryPRTriggeredState state)
 {
     return(state.ToCreateInventoryPRTriggered <CreateInventoryPRTriggered>());
 }
Пример #4
0
 public static MergePatchInventoryPRTriggered ToMergePatchInventoryPRTriggered(this InventoryPRTriggeredState state)
 {
     return(state.ToMergePatchInventoryPRTriggered <MergePatchInventoryPRTriggered>());
 }
Пример #5
0
 public static DeleteInventoryPRTriggered ToDeleteInventoryPRTriggered(this InventoryPRTriggeredState state)
 {
     return(state.ToDeleteInventoryPRTriggered <DeleteInventoryPRTriggered>());
 }
Пример #6
0
 public static IInventoryPRTriggeredCommand ToCreateOrMergePatchInventoryPRTriggered(this InventoryPRTriggeredState state)
 {
     return(state.ToCreateOrMergePatchInventoryPRTriggered <CreateInventoryPRTriggered, MergePatchInventoryPRTriggered>());
 }