public ActionResult Activate(int id) { if (_userRepository.Activate(id)) { return(RedirectToAction("Index")); } return(RedirectToAction("Index")); }
public async Task <ActivateUserViewModel> Handle(ActivateUserCommand request, CancellationToken cancellationToken) { var user = await _userRepository.GetUserAsync(request.Id); if (user == null) { return(null); } await _userRepository.Activate(user); return(new ActivateUserViewModel(user.Name, user.Email)); }
public IActionResult ActivateUser(int id) { _loggerManager.Info($"ActivateUser({id}) was requested"); var result = _userRepository.Activate(id, HttpContext.GetUserId()); if (result) { _loggerManager.Info($"ActivateUser({id}) successfully activaed"); } else { _loggerManager.Warn($"ActivateUser({id}) was unable to activate"); } return(new JsonResult(new { result })); }
public async Task <ActionResult> ActivateUser(int id) { try { var resultado = await _userRepository.Activate(id); if (!resultado) { return(BadRequest()); } return(NoContent()); } catch (Exception excepcion) { return(BadRequest()); } }
public async Task <string> Activate(IUser user) { string result = string.Empty; if (user == null) { return("User is null"); } var response = await _userRepository.Activate(user); if (!string.IsNullOrEmpty(response)) { return($"Request not successful: {response}"); } return(result); }
/// <summary> /// Method activates selected student /// </summary> /// <param name="username">name of selected student</param> /// <returns>activated student</returns> public User Activate(string username) { var user = _userRepository.Activate(username); return(user); }
public void Handle(ActivateUser message) { _userRepository.Activate(message.Token); }
public User Activate(User entity) { return(repository.Activate(entity)); }
public void Activate(string email) { _userRepository.Activate(email); }