public virtual IAttributeSetInstanceExtensionFieldState ToAttributeSetInstanceExtensionFieldState()
        {
            var state = new AttributeSetInstanceExtensionFieldState(true);

            state.Name        = this.Name;
            state.Type        = this.Type;
            state.Length      = this.Length;
            state.Alias       = this.Alias;
            state.Description = this.Description;
            state.GroupId     = this.GroupId;
            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(IAttributeSetInstanceExtensionFieldStateCreated stateCreated)
        {
            var aggregateId = stateCreated.AttributeSetInstanceExtensionFieldEventId.Name;
            var state       = new AttributeSetInstanceExtensionFieldState();

            state.Name = aggregateId;
            var aggregate = (AttributeSetInstanceExtensionFieldAggregate)GetAttributeSetInstanceExtensionFieldAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
 public static CreateAttributeSetInstanceExtensionField ToCreateAttributeSetInstanceExtensionField(this AttributeSetInstanceExtensionFieldState state)
 {
     return(state.ToCreateAttributeSetInstanceExtensionField <CreateAttributeSetInstanceExtensionField>());
 }
 public static MergePatchAttributeSetInstanceExtensionField ToMergePatchAttributeSetInstanceExtensionField(this AttributeSetInstanceExtensionFieldState state)
 {
     return(state.ToMergePatchAttributeSetInstanceExtensionField <MergePatchAttributeSetInstanceExtensionField>());
 }
 public static IAttributeSetInstanceExtensionFieldCommand ToCreateOrMergePatchAttributeSetInstanceExtensionField(this AttributeSetInstanceExtensionFieldState state)
 {
     return(state.ToCreateOrMergePatchAttributeSetInstanceExtensionField <CreateAttributeSetInstanceExtensionField, MergePatchAttributeSetInstanceExtensionField>());
 }