Esempio n. 1
0
 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));
 }
Esempio n. 3
0
        public IActionResult Create(NewBoard newBoardViewModel)
        {
            _boardService.AddBoard(newBoardViewModel.Title);

            return(base.RedirectToAction(nameof(Index)));
        }
Esempio n. 4
0
        public IActionResult Create(NewBoard viewModel)
        {
            _boardService.AddBoard(viewModel);

            return(RedirectToAction(nameof(Index)));
        }