public IActionResult Add(NewTaskViewModel data) { if (!ModelState.IsValid) { return(View(data)); } _taskListService.Add(data.Title, data.Desc); return(RedirectToAction("Index", "Home")); }
public IActionResult Add(NewTaskViewModel newTaskViewModel) { if (!ModelState.IsValid) { return(View(newTaskViewModel)); } _contetx.Add(newTaskViewModel.Title, newTaskViewModel.Desc); return(RedirectToAction("Index", "Home")); }