public virtual IRoleTypeState ToRoleTypeState() { var state = new RoleTypeState(true); state.RoleTypeId = this.RoleTypeId; 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(IRoleTypeStateCreated stateCreated) { var aggregateId = stateCreated.RoleTypeEventId.RoleTypeId; var state = new RoleTypeState(); state.RoleTypeId = aggregateId; var aggregate = (RoleTypeAggregate)GetRoleTypeAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public static CreateRoleType ToCreateRoleType(this RoleTypeState state) { return(state.ToCreateRoleType <CreateRoleType>()); }
public static MergePatchRoleType ToMergePatchRoleType(this RoleTypeState state) { return(state.ToMergePatchRoleType <MergePatchRoleType>()); }
public static DeleteRoleType ToDeleteRoleType(this RoleTypeState state) { return(state.ToDeleteRoleType <DeleteRoleType>()); }
public static IRoleTypeCommand ToCreateOrMergePatchRoleType(this RoleTypeState state) { return(state.ToCreateOrMergePatchRoleType <CreateRoleType, MergePatchRoleType>()); }