public Task <ICommandResult> Handle(ActiveUserCommand request, CancellationToken cancellationToken) { var user = _userRepository.GetByEmail(request.Email); user.ActivateUser(); _userRepository.Update(user); if (Commit()) { _bus.RaiseEvent(new ActiveUserAccountEvent(user.Email)); } return(CompletedTask()); }
public async Task <IHttpActionResult> Put(ActiveUserCommand command) { try { await _appRepository.ActiveUser(command.UserId, command.AppType); return(Ok(new ResponseModel { Message = "فعال سازی کاربر", Success = true, })); } catch (Exception e) { return(Ok(new ResponseModel { Message = e.Message, Success = false, })); } }
public IActionResult ActiveInstitution([FromBody] ActiveUserCommand command) => Response(bus.SendCommand(command).Result);