//Create public bool Create(TagViewCreateModel model) { var tag = new Tag { UserId = model.UserId, Name = model.Name, Description = model.Description }; tag = tagRepo.Create(tag); return(tag.Id != 0); }
public ActionResult Create(TagViewCreateModel model) { if (!ModelState.IsValid) { return(View(model)); } model.UserId = Guid.Parse(User.Identity.GetUserId()); if (TagService.Create(model)) { TempData["SaveResult"] = "Your tag was created."; return(RedirectToAction("Index")); } ; ModelState.AddModelError("", "Tag could not be created."); return(View(model)); }
//GET public ActionResult Create() { TagViewCreateModel model = new TagViewCreateModel(); return(View(model)); }