Пример #1
0
        private UserRoleEventId NewUserRoleEventId(string roleId)
        {
            var eId = new UserRoleEventId();

            eId.UserId      = this.UserEventId.UserId;
            eId.RoleId      = roleId;
            eId.UserVersion = this.UserEventId.Version;
            return(eId);
        }
Пример #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
        protected virtual IUserRoleStateCreated MapCreate(ICreateUserRole c, IUserCommand outerCommand, long version, IUserState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId        = new UserRoleEventId(c.UserId, c.RoleId, version);
            IUserRoleStateCreated e = NewUserRoleStateCreated(stateEventId);
            var s = outerState.UserRoles.Get(c.RoleId, true);

            e.Active = c.Active;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            return(e);
        }// END Map(ICreate... ////////////////////////////
Пример #4
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            UserRoleEventId other = obj as UserRoleEventId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.UserId, other.UserId) &&
                   Object.Equals(this.RoleId, other.RoleId) &&
                   Object.Equals(this.UserVersion, other.UserVersion)
                   );
        }
Пример #5
0
 private UserRoleStateRemoved NewUserRoleStateRemoved(UserRoleEventId stateEventId)
 {
     return(new UserRoleStateRemoved(stateEventId));
 }
Пример #6
0
 private UserRoleStateMergePatched NewUserRoleStateMergePatched(UserRoleEventId stateEventId)
 {
     return(new UserRoleStateMergePatched(stateEventId));
 }
Пример #7
0
 protected UserRoleEventBase(UserRoleEventId stateEventId)
 {
     this.UserRoleEventId = stateEventId;
 }
Пример #8
0
 public UserRoleStateRemoved(UserRoleEventId stateEventId) : base(stateEventId)
 {
 }
Пример #9
0
 public UserRoleStateMergePatched(UserRoleEventId stateEventId) : base(stateEventId)
 {
 }
Пример #10
0
 public UserRoleStateCreated(UserRoleEventId stateEventId) : base(stateEventId)
 {
 }
Пример #11
0
 protected UserRoleStateEventBase(UserRoleEventId stateEventId) : base(stateEventId)
 {
 }
Пример #12
0
        protected UserRoleEventId NewUserRoleEventId(string roleId)
        {
            var stateEventId = new UserRoleEventId(this.UserEventId.UserId, roleId, this.UserEventId.Version);

            return(stateEventId);
        }