Example #1
0
 public Task<OperationResponse> UpdateUserAsync(UpdateUserCommand command)
 {
     return command.Validate(new UpdateUserCommandValidator())
         .IfValidAsync( () => _unitOfWorkFactory.DoAsync(() =>
     {
         var user = _userRepository.GetById(command.Id);
         user.Email = command.Email;
         user.UserName = command.UserName;
         _userRepository.Update(user);
     }));
 }