Esempio n. 1
0
        public virtual IGoodIdentificationTypeState ToGoodIdentificationTypeState()
        {
            var state = new GoodIdentificationTypeState(true);

            state.GoodIdentificationTypeId = this.GoodIdentificationTypeId;
            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(IGoodIdentificationTypeStateCreated stateCreated)
        {
            var aggregateId = stateCreated.GoodIdentificationTypeEventId.GoodIdentificationTypeId;
            var state       = new GoodIdentificationTypeState();

            state.GoodIdentificationTypeId = aggregateId;
            var aggregate = (GoodIdentificationTypeAggregate)GetGoodIdentificationTypeAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
Esempio n. 3
0
 public static CreateGoodIdentificationType ToCreateGoodIdentificationType(this GoodIdentificationTypeState state)
 {
     return(state.ToCreateGoodIdentificationType <CreateGoodIdentificationType>());
 }
Esempio n. 4
0
 public static MergePatchGoodIdentificationType ToMergePatchGoodIdentificationType(this GoodIdentificationTypeState state)
 {
     return(state.ToMergePatchGoodIdentificationType <MergePatchGoodIdentificationType>());
 }
Esempio n. 5
0
 public static DeleteGoodIdentificationType ToDeleteGoodIdentificationType(this GoodIdentificationTypeState state)
 {
     return(state.ToDeleteGoodIdentificationType <DeleteGoodIdentificationType>());
 }
Esempio n. 6
0
 public static IGoodIdentificationTypeCommand ToCreateOrMergePatchGoodIdentificationType(this GoodIdentificationTypeState state)
 {
     return(state.ToCreateOrMergePatchGoodIdentificationType <CreateGoodIdentificationType, MergePatchGoodIdentificationType>());
 }