public IActionResult Add(NewTaskViewModel data)
        {
            if (!ModelState.IsValid)
            {
                return(View(data));
            }

            _taskListService.Add(data.Title, data.Desc);

            return(RedirectToAction("Index", "Home"));
        }
Beispiel #2
0
        public IActionResult Add(NewTaskViewModel newTaskViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(newTaskViewModel));
            }

            _contetx.Add(newTaskViewModel.Title, newTaskViewModel.Desc);

            return(RedirectToAction("Index", "Home"));
        }