Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BlogUser blogUser = blogUserManager.Find(x => x.Id == id);

            blogUserManager.DeleteUser(blogUser);


            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public ActionResult DeleteProfile()
        {
            BlogUsers user = Session["login"] as BlogUsers;

            BusinessResult <BlogUsers> _result = blogUserManager.DeleteUser(user.Id);

            if (_result.Errors.Count > 0)
            {
                ModelState.AddModelError("", "Error");
                return(RedirectToAction("/Home/ShowProfile"));
            }

            Session.Clear();
            return(RedirectToAction("Index"));;
        }