public ActionResult AddTags(TagRegisterModel model) { if (ModelState.IsValid) { if (tagServices.AddTag(model) != Guid.Empty) { return(Redirect("Tags")); } return(HttpNotFound()); } else { return(View(model)); } }
public Guid AddTag(TagRegisterModel model) { try { var result = new Tags() { TagName = model.TagName, TagType = model.TagType, IsActive = true, }; unitOfWork.TagRepo.Insert(result); if (unitOfWork.Save() > 0) { return(result.Id); } return(Guid.Empty); } catch (Exception) { throw; } }