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

            this.Deleted   = true;
            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
        public virtual LocatorStateDeletedDto ToLocatorStateDeletedDto(ILocatorStateDeleted e)
        {
            var dto = new LocatorStateDeletedDto();

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

            return(dto);
        }
Beispiel #3
0
        protected virtual ILocatorStateDeleted Map(IDeleteLocator c)
        {
            var stateEventId       = new LocatorEventId(c.LocatorId, c.Version);
            ILocatorStateDeleted e = NewLocatorStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


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


            return(e);
        }
Beispiel #4
0
        protected virtual ILocatorStateDeleted Map(IDeleteLocator c)
        {
            var stateEventId       = new LocatorStateEventId(c.LocatorId, c.Version);
            ILocatorStateDeleted e = NewLocatorStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


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


            return(e);
        }
Beispiel #5
0
        protected virtual ILocatorStateDeleted Map(IDeleteLocator c)
        {
            var stateEventId       = new LocatorStateEventId(c.LocatorId, c.Version);
            ILocatorStateDeleted e = NewLocatorStateDeleted(stateEventId);

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


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


            return(e);
        }
Beispiel #6
0
 void ILocatorState.When(ILocatorStateDeleted e)
 {
     throw new NotSupportedException();
 }
Beispiel #7
0
 public void AddLocatorEvent(ILocatorStateDeleted e)
 {
     _innerStateEvents.Add((LocatorStateDeletedDto)e);
 }
Beispiel #8
0
        public virtual void Delete(IDeleteLocator c)
        {
            ILocatorStateDeleted e = Map(c);

            Apply(e);
        }