public ServiceResult <ArticleType> Create(ArticleType articleType) { var validResult = ValidParentId(articleType); if (validResult.HasViolation) { return(validResult); } return(_articleTypeService.Add(articleType)); }
public ActionResult Add(ArticleType articleType) { if (ModelState.IsValid) { var errors = _articleTypeService.ValidateArticleType(articleType); if (!errors.Any()) { _articleTypeService.Add(articleType); return(RedirectToAction("Manage")); } ModelState.Merge(errors); } return(View(articleType)); }