public ActionResult GenreDelete(int id) { try { if (genresDb.GetGenreById(id) != null) { genresDb.DeleteById(id); messagesGenreTable = Resources.Resource.MessageDeleted; } else { messagesGenreTable = Resources.Resource.ErrorFound; } return(RedirectToAction("GenresTable", "Admin")); } catch { messagesGenreTable = Resources.Resource.Error; return(RedirectToAction("GenresTable", "Admin")); } }