public async Task <IActionResult> Edit(String id) { ApplicationUser user = await userAccountPresentationService.FindById(id); if (user != null) { return(View(user)); } else { return(RedirectToAction("Home")); } }
public async Task <IActionResult> Delete(String id) { ApplicationUser user = await userAccountPresentationService.FindById(id); if (user != null) { // Remove all todos user todoPresintationService.RemoveAll(id).Wait(); // Delete user IdentityResult deleteUser = await userAccountPresentationService.Delete(user); if (deleteUser.Succeeded) { return(RedirectToAction("Index")); } else { AddErrorsFromResult(deleteUser); } } else { ModelState.AddModelError("", "User Not Found"); } return(View("Index", userAccountPresentationService.Users)); }