Exemplo n.º 1
0
 /// <summary>
 /// 处理 更新密码事件
 /// </summary>
 /// <param name="evnt"></param>
 /// <returns></returns>
 public Task <AsyncTaskResult> HandleAsync(UserPasswordUpdatedEvent evnt)
 {
     return(TryUpdateRecordAsync(connection =>
     {
         return connection.UpdateAsync(new
         {
             Password = evnt.Password,
             Version = evnt.Version,
             EventSequence = evnt.Sequence
         }, new
         {
             Id = evnt.AggregateRootId,
             //Version = evnt.Version - 1
         }, ConfigSettings.UserTable);
     }));
 }
Exemplo n.º 2
0
        public async Task Handle(UserPasswordUpdatedEvent notification, CancellationToken cancellationToken)
        {
            var model = await _documentRepository
                        .SingleOrDefault(m => m.Id == notification.EntityId);

            if (model == null)
            {
                return;
            }

            model.Password = notification.HashedPassword;
            await _documentRepository.Update(model, m => m.Id == notification.EntityId,
                                             TenantId.Create(notification.TenantId));

            _logger.LogInformation($"User {model.Email} password has been projected");
        }
 protected void Handle(UserPasswordUpdatedEvent @event)
 {
     Password = Password.Create(@event.HashedPassword, false);
 }
        public void UpdatePassword(Password password)
        {
            var @event = new UserPasswordUpdatedEvent(Id, password.ToString());

            Emit(@event);
        }
Exemplo n.º 5
0
 private void Handle(UserPasswordUpdatedEvent evnt)
 {
     _info.Password = evnt.Password;
 }
 public void Handle(UserPasswordUpdatedEvent notification)
 {
 }