示例#1
0
        public async Task Handle(EmailChanged e, IHandleContext ctx)
        {
            var get = await _uow.Get <presentationUsers.Models.AU_UserResponse>(e.UserId);

            get.Email = e.Email;

            _uow.Save(get);
            ctx.UpdateAsync(get, ChangeType.CHANGE);
        }
示例#2
0
        public async Task Handle(RolesUnassigned e, IHandleContext ctx)
        {
            var get = await _uow.Get <presentationUsers.Models.AU_UserResponse>(e.UserAuthId);

            get.Roles = get.Roles.Except(e.Roles).Distinct();

            _uow.Save(get);
            ctx.UpdateAsync(get, ChangeType.CHANGE);
        }
示例#3
0
        public async Task Handle(Deactivated e, IHandleContext ctx)
        {
            var get = await _uow.Get <presentationUsers.Models.AU_UserResponse>(e.UserAuthId);

            get.LockedDate = DateTime.UtcNow;

            _uow.Save(get);
            ctx.UpdateAsync(get, ChangeType.CHANGE);
        }
示例#4
0
        public async Task Handle(LoggedIn e, IHandleContext ctx)
        {
            var get = await _uow.Get <presentationUsers.Models.AU_UserResponse>(e.UserId);

            get.LastLoginAttempt = DateTime.UtcNow;

            _uow.Save(get);
            ctx.UpdateAsync(get, ChangeType.CHANGE);

            _Demo.Report("Login", new { Name = get.Name, Id = get.Id, Email = get.Email });
        }
示例#5
0
        public Task Handle(Registered e, IHandleContext ctx)
        {
            var get = new presentationUsers.Models.AU_UserResponse
            {
                Id       = e.UserAuthId,
                Password = e.Password
            };

            _uow.Save(get);
            ctx.UpdateAsync(get, ChangeType.NEW);

            return(Task.FromResult(0));
        }
示例#6
0
        public async Task Handle(Updated e, IHandleContext ctx)
        {
            var get = await _uow.Get <presentationUsers.Models.AU_UserResponse>(e.UserAuthId);

            get.Name         = e.DisplayName;
            get.Email        = e.PrimaryEmail;
            get.Nickname     = e.Nickname;
            get.Timezone     = e.Timezone;
            get.ModifiedDate = DateTime.UtcNow;

            _uow.Save(get);
            ctx.UpdateAsync(get, ChangeType.CHANGE);
        }