Guest User

Untitled

a guest
Oct 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public async Task<ActionResult> Delete(string id)
  2. {
  3. ApplicationUser user = await userManager.FindByIdAsync(id);
  4.  
  5. if (user != null)
  6. {
  7. IdentityResult result = await userManager.DeleteAsync(user);
  8.  
  9. if (result.Succeeded)
  10. {
  11. return RedirectToAction("Index");
  12. }
  13. else
  14. {
  15. TempData["Error"] = "Error!";
  16. return RedirectToAction("Index");
  17. }
  18. }
  19.  
  20. TempData["Error"] = "Error!";
  21. return RedirectToAction("Index");
  22. }
Add Comment
Please, Sign In to add comment