示例#1
0
        public virtual void When(IUserRoleStateRemoved e)
        {
            ThrowOnWrongEvent(e);

            this.Deleted   = true;
            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
示例#2
0
        }// END Map(IMergePatch... ////////////////////////////

        protected virtual IUserRoleStateRemoved MapRemove(IRemoveUserRole c, IUserCommand outerCommand, long version)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId        = new UserRoleEventId(c.UserId, c.RoleId, version);
            IUserRoleStateRemoved e = NewUserRoleStateRemoved(stateEventId);


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

            return(e);
        }// END Map(IRemove... ////////////////////////////
示例#3
0
        }// END Map(IMergePatch... ////////////////////////////

        protected virtual IUserRoleStateRemoved MapRemove(IRemoveUserRole c, IUserCommand outerCommand, long version)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId        = new UserRoleStateEventId(c.UserId, c.RoleId, version);
            IUserRoleStateRemoved e = NewUserRoleStateRemoved(stateEventId);


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

            return(e);
        }// END Map(IRemove... ////////////////////////////
        public virtual UserRoleStateRemovedDto ToUserRoleStateRemovedDto(IUserRoleStateRemoved e)
        {
            var dto = new UserRoleStateRemovedDto();

            dto.UserRoleEventId = e.UserRoleEventId;
            dto.CreatedAt       = e.CreatedAt;
            dto.CreatedBy       = e.CreatedBy;
            dto.Version         = e.Version;
            dto.CommandId       = e.CommandId;

            return(dto);
        }
示例#5
0
 void IUserStateDeleted.AddUserRoleEvent(IUserRoleStateRemoved e)
 {
     this._userRoleEvents.AddUserRoleEvent(e);
 }
示例#6
0
 public virtual void AddUserRoleEvent(IUserRoleStateRemoved e)
 {
     ThrowOnInconsistentEventIds(e);
     this._userRoleEvents[e.StateEventId] = e;
 }
示例#7
0
 public void AddUserRoleEvent(IUserRoleStateRemoved e)
 {
     _innerStateEvents.Add((UserRoleStateRemovedDto)e);
 }
示例#8
0
 void IUserRoleState.When(IUserRoleStateRemoved e)
 {
     throw new NotSupportedException();
 }