public IActionResult Submit(SubmitTalkViewModel model) { talkService.AddTalk(new Domain.Talk { Title = model.Title, Level = model.Level, Tags = model.TagList, TimesPresented = model.TimesPresented, Abstract = model.Abstract }); return(View("TalkSubmitted", new TalkSubmittedViewModel { Title = model.Title })); }
public ActionResult Create(TalksViewModel model) { if (ModelState.IsValid) { Talks talk = new Talks(); talk.InjectFrom(model); var createNewTalk = talkService.AddTalk(talk); if (createNewTalk == null) { ModelState.AddModelError("Name", "The Name must be unique!"); return(View(model)); } } return(RedirectToAction(nameof(Index))); }