public ActionResult DeleteProfile() { MyUser currentUser = Session["login"] as MyUser; MyUserManager userManager = new MyUserManager(); BusinessLayerResult <MyUser> res = userManager.DeleteUserById(currentUser.Id); if (res.Errors.Count > 0) { ErrorViewModel errorNotifyObj = new ErrorViewModel() { Items = res.Errors, Title = "Profile could not deleted", RedirectingUrl = "/Home/ShowProfile" }; return(View("Error", errorNotifyObj)); } Session.Clear(); return(RedirectToAction("Index")); }