public virtual IRejectionReasonState ToRejectionReasonState() { var state = new RejectionReasonState(true); state.RejectionReasonId = this.RejectionReasonId; 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(IRejectionReasonStateCreated stateCreated) { var aggregateId = stateCreated.RejectionReasonEventId.RejectionReasonId; var state = new RejectionReasonState(); state.RejectionReasonId = aggregateId; var aggregate = (RejectionReasonAggregate)GetRejectionReasonAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public static CreateRejectionReason ToCreateRejectionReason(this RejectionReasonState state) { return(state.ToCreateRejectionReason <CreateRejectionReason>()); }
public static MergePatchRejectionReason ToMergePatchRejectionReason(this RejectionReasonState state) { return(state.ToMergePatchRejectionReason <MergePatchRejectionReason>()); }
public static DeleteRejectionReason ToDeleteRejectionReason(this RejectionReasonState state) { return(state.ToDeleteRejectionReason <DeleteRejectionReason>()); }
public static IRejectionReasonCommand ToCreateOrMergePatchRejectionReason(this RejectionReasonState state) { return(state.ToCreateOrMergePatchRejectionReason <CreateRejectionReason, MergePatchRejectionReason>()); }