protected virtual IAttributeSetInstanceExtensionFieldGroupStateCreated Map(ICreateAttributeSetInstanceExtensionFieldGroup c)
        {
            var stateEventId = new AttributeSetInstanceExtensionFieldGroupStateEventId(c.Id, c.Version);
            IAttributeSetInstanceExtensionFieldGroupStateCreated e = NewAttributeSetInstanceExtensionFieldGroupStateCreated(stateEventId);

            e.FieldType   = c.FieldType;
            e.FieldLength = c.FieldLength;
            e.FieldCount  = c.FieldCount;
            e.NameFormat  = c.NameFormat;
            e.Description = c.Description;
            e.Active      = c.Active;
            ReflectUtils.CopyPropertyValue("CommandId", c, e);


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = DateTime.Now;
            var version = c.Version;

            foreach (ICreateAttributeSetInstanceExtensionField innerCommand in c.Fields)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IAttributeSetInstanceExtensionFieldStateCreated innerEvent = MapCreate(innerCommand, c, version, _state);
                e.AddAttributeSetInstanceExtensionFieldEvent(innerEvent);
            }


            return(e);
        }
Exemple #2
0
        protected virtual IAttributeSetInstanceExtensionFieldGroupStateCreated Map(ICreateAttributeSetInstanceExtensionFieldGroup c)
        {
            var stateEventId = new AttributeSetInstanceExtensionFieldGroupEventId(c.Id, c.Version);
            IAttributeSetInstanceExtensionFieldGroupStateCreated e = NewAttributeSetInstanceExtensionFieldGroupStateCreated(stateEventId);

            e.FieldType   = c.FieldType;
            e.FieldLength = c.FieldLength;
            e.FieldCount  = c.FieldCount;
            e.NameFormat  = c.NameFormat;
            e.Description = c.Description;
            e.Active      = c.Active;
            e.CommandId   = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            var version = c.Version;


            return(e);
        }
 void IAttributeSetInstanceExtensionFieldGroupApplicationService.When(ICreateAttributeSetInstanceExtensionFieldGroup c)
 {
     this.When((CreateAttributeSetInstanceExtensionFieldGroupDto)c);
 }
Exemple #4
0
        public virtual void Create(ICreateAttributeSetInstanceExtensionFieldGroup c)
        {
            IAttributeSetInstanceExtensionFieldGroupStateCreated e = Map(c);

            Apply(e);
        }
 public virtual void When(ICreateAttributeSetInstanceExtensionFieldGroup c)
 {
     Update(c, ar => ar.Create(c));
 }