public ActionResult Add(PostCategory category) { ValidateCategory(category); if (ModelState.IsValid) { _categoryRepository.Add(category); TempData["Message"] = "Your category has been added."; return(RedirectToAction("Details", new { id = category.Id })); } return(View(category)); }
public PostCategory Add(PostCategory postCategory) { return(_postCategoryRepository.Add(postCategory)); }