public ActionResult DeleteLogin(int id) { if (this.Authorizer.IsLogedIn(this.Session, this.Request)) { this.Authorizer.ReauthorizeLogin(this.Session); DBLoginRepository repository = new DBLoginRepository(this.DatabaseContext); DBLogin login = repository.Find(id); if ((this.Session["authorized"] as DBLogin).ID != id) { repository.Remove(login, true); } return(RedirectToAction("Logins")); } return(RedirectToAction("Index", "Login")); }