public virtual void Initialize(IAttributeAliasMvoStateCreated stateCreated) { var aggregateId = stateCreated.AttributeAliasMvoEventId.AttributeAliasId; var state = new AttributeAliasMvoState(); state.AttributeAliasId = aggregateId; var aggregate = (AttributeAliasMvoAggregate)GetAttributeAliasMvoAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public virtual IAttributeAliasMvoState ToAttributeAliasMvoState() { var state = new AttributeAliasMvoState(true); state.AttributeAliasId = this.AttributeAliasId; state.Name = this.Name; if (this.Version != null && this.Version.HasValue) { state.Version = this.Version.Value; } if (this.Active != null && this.Active.HasValue) { state.Active = this.Active.Value; } state.AttributeAttributeName = this.AttributeAttributeName; state.AttributeOrganizationId = this.AttributeOrganizationId; state.AttributeDescription = this.AttributeDescription; if (this.AttributeIsMandatory != null && this.AttributeIsMandatory.HasValue) { state.AttributeIsMandatory = this.AttributeIsMandatory.Value; } state.AttributeAttributeValueType = this.AttributeAttributeValueType; state.AttributeAttributeValueLength = this.AttributeAttributeValueLength; if (this.AttributeIsList != null && this.AttributeIsList.HasValue) { state.AttributeIsList = this.AttributeIsList.Value; } state.AttributeFieldName = this.AttributeFieldName; state.AttributeReferenceId = this.AttributeReferenceId; state.AttributeCreatedBy = this.AttributeCreatedBy; if (this.AttributeCreatedAt != null && this.AttributeCreatedAt.HasValue) { state.AttributeCreatedAt = this.AttributeCreatedAt.Value; } state.AttributeUpdatedBy = this.AttributeUpdatedBy; if (this.AttributeUpdatedAt != null && this.AttributeUpdatedAt.HasValue) { state.AttributeUpdatedAt = this.AttributeUpdatedAt.Value; } if (this.AttributeActive != null && this.AttributeActive.HasValue) { state.AttributeActive = this.AttributeActive.Value; } if (this.AttributeDeleted != null && this.AttributeDeleted.HasValue) { state.AttributeDeleted = this.AttributeDeleted.Value; } if (this.AttributeVersion != null && this.AttributeVersion.HasValue) { state.AttributeVersion = this.AttributeVersion.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 static CreateAttributeAliasMvo ToCreateAttributeAliasMvo(this AttributeAliasMvoState state) { return(state.ToCreateAttributeAliasMvo <CreateAttributeAliasMvo>()); }
public static MergePatchAttributeAliasMvo ToMergePatchAttributeAliasMvo(this AttributeAliasMvoState state) { return(state.ToMergePatchAttributeAliasMvo <MergePatchAttributeAliasMvo>()); }
public static DeleteAttributeAliasMvo ToDeleteAttributeAliasMvo(this AttributeAliasMvoState state) { return(state.ToDeleteAttributeAliasMvo <DeleteAttributeAliasMvo>()); }
public static IAttributeAliasMvoCommand ToCreateOrMergePatchAttributeAliasMvo(this AttributeAliasMvoState state) { return(state.ToCreateOrMergePatchAttributeAliasMvo <CreateAttributeAliasMvo, MergePatchAttributeAliasMvo>()); }