示例#1
0
 public ActionResult AddCategory(Category newCategory)
 {
     if (newCategory == null || string.IsNullOrEmpty(newCategory.CategoryName))
     {
         throw new ArgumentException();
     }
     try
     {
         _blogServices.AddCategory(newCategory);
         return(RedirectToAction("AdminPanel", "Admin"));
     }
     catch (Exception)
     {
         throw;
     }
 }