public virtual IOrganizationStructureTypeState ToOrganizationStructureTypeState() { var state = new OrganizationStructureTypeState(true); state.Id = this.Id; 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(IOrganizationStructureTypeStateCreated stateCreated) { var aggregateId = stateCreated.OrganizationStructureTypeEventId.Id; var state = new OrganizationStructureTypeState(); state.Id = aggregateId; var aggregate = (OrganizationStructureTypeAggregate)GetOrganizationStructureTypeAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public static CreateOrganizationStructureType ToCreateOrganizationStructureType(this OrganizationStructureTypeState state) { return(state.ToCreateOrganizationStructureType <CreateOrganizationStructureType>()); }
public static MergePatchOrganizationStructureType ToMergePatchOrganizationStructureType(this OrganizationStructureTypeState state) { return(state.ToMergePatchOrganizationStructureType <MergePatchOrganizationStructureType>()); }
public static DeleteOrganizationStructureType ToDeleteOrganizationStructureType(this OrganizationStructureTypeState state) { return(state.ToDeleteOrganizationStructureType <DeleteOrganizationStructureType>()); }
public static IOrganizationStructureTypeCommand ToCreateOrMergePatchOrganizationStructureType(this OrganizationStructureTypeState state) { return(state.ToCreateOrMergePatchOrganizationStructureType <CreateOrganizationStructureType, MergePatchOrganizationStructureType>()); }