コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public static CreateOrganizationStructureType ToCreateOrganizationStructureType(this OrganizationStructureTypeState state)
 {
     return(state.ToCreateOrganizationStructureType <CreateOrganizationStructureType>());
 }
コード例 #4
0
 public static MergePatchOrganizationStructureType ToMergePatchOrganizationStructureType(this OrganizationStructureTypeState state)
 {
     return(state.ToMergePatchOrganizationStructureType <MergePatchOrganizationStructureType>());
 }
コード例 #5
0
 public static DeleteOrganizationStructureType ToDeleteOrganizationStructureType(this OrganizationStructureTypeState state)
 {
     return(state.ToDeleteOrganizationStructureType <DeleteOrganizationStructureType>());
 }
コード例 #6
0
 public static IOrganizationStructureTypeCommand ToCreateOrMergePatchOrganizationStructureType(this OrganizationStructureTypeState state)
 {
     return(state.ToCreateOrMergePatchOrganizationStructureType <CreateOrganizationStructureType, MergePatchOrganizationStructureType>());
 }