Example #1
0
        public virtual void When(IAttributeValueMvoStateDeleted e)
        {
            ThrowOnWrongEvent(e);

            this.Deleted   = true;
            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
        protected virtual IAttributeValueMvoStateDeleted Map(IDeleteAttributeValueMvo c)
        {
            var stateEventId = new AttributeValueMvoStateEventId(c.AttributeValueId, c.AttributeVersion);
            IAttributeValueMvoStateDeleted e = NewAttributeValueMvoStateDeleted(stateEventId);

            ReflectUtils.CopyPropertyValue("CommandId", c, e);


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


            return(e);
        }
        protected virtual IAttributeValueMvoStateDeleted Map(IDeleteAttributeValueMvo c)
        {
            var stateEventId = new AttributeValueMvoEventId(c.AttributeValueId, c.AttributeVersion);
            IAttributeValueMvoStateDeleted e = NewAttributeValueMvoStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


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


            return(e);
        }
Example #4
0
 void IAttributeValueMvoState.When(IAttributeValueMvoStateDeleted e)
 {
     throw new NotSupportedException();
 }
Example #5
0
        public virtual AttributeValueMvoStateDeletedDto ToAttributeValueMvoStateDeletedDto(IAttributeValueMvoStateDeleted e)
        {
            var dto = new AttributeValueMvoStateDeletedDto();

            dto.StateEventId = new AttributeValueMvoStateEventIdDtoWrapper(e.StateEventId);
            dto.CreatedAt    = e.CreatedAt;
            dto.CreatedBy    = e.CreatedBy;
            dto.CommandId    = e.CommandId;

            return(dto);
        }
        public virtual void Delete(IDeleteAttributeValueMvo c)
        {
            IAttributeValueMvoStateDeleted e = Map(c);

            Apply(e);
        }
 public void AddAttributeValueMvoEvent(IAttributeValueMvoStateDeleted e)
 {
     _innerStateEvents.Add((AttributeValueMvoStateDeletedDto)e);
 }