public ActionResult Delete(int id) { Database database = Databases.Get(id); if (database == null || database.OwnerID != UserAccount.ID) { ShowMessage("No such database", HtmlMessageType.Error); return(RedirectToAction("index")); } Databases.Delete(database); return(RedirectToAction("index")); }