public IActionResult Create(NewBoard vm) { if (ModelState.IsValid) { boardService.AddBoard(vm); return(RedirectToAction(nameof(Index))); } return(View(vm)); }
public ActionResult Index(BoardService boardService, BoardModel model) { if (ModelState.IsValid) { boardService = new BoardService(); boardService.AddBoard(model.BoardName, model.BoardDescription); string currentURL = this.Request.UrlReferrer.AbsolutePath; return(Redirect(currentURL)); } return(View(model)); }
public IActionResult Create(NewBoard newBoardViewModel) { _boardService.AddBoard(newBoardViewModel.Title); return(base.RedirectToAction(nameof(Index))); }
public IActionResult Create(NewBoard viewModel) { _boardService.AddBoard(viewModel); return(RedirectToAction(nameof(Index))); }