Beispiel #1
0
        public virtual void When(IDamageReasonStateDeleted e)
        {
            ThrowOnWrongEvent(e);

            this.Deleted   = true;
            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
        public virtual DamageReasonStateDeletedDto ToDamageReasonStateDeletedDto(IDamageReasonStateDeleted e)
        {
            var dto = new DamageReasonStateDeletedDto();

            dto.DamageReasonEventId = e.DamageReasonEventId;
            dto.CreatedAt           = e.CreatedAt;
            dto.CreatedBy           = e.CreatedBy;
            dto.CommandId           = e.CommandId;

            return(dto);
        }
Beispiel #3
0
        protected virtual IDamageReasonStateDeleted Map(IDeleteDamageReason c)
        {
            var stateEventId            = new DamageReasonEventId(c.DamageReasonId, c.Version);
            IDamageReasonStateDeleted e = NewDamageReasonStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


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


            return(e);
        }
 void IDamageReasonState.When(IDamageReasonStateDeleted e)
 {
     throw new NotSupportedException();
 }
 public void AddDamageReasonEvent(IDamageReasonStateDeleted e)
 {
     _innerStateEvents.Add((DamageReasonStateDeletedDto)e);
 }
Beispiel #6
0
        public virtual void Delete(IDeleteDamageReason c)
        {
            IDamageReasonStateDeleted e = Map(c);

            Apply(e);
        }