public IActionResult Add(HomeViewModel item) { item.NewToDoITem.CreatedDate = DateTime.Now; item.NewToDoITem.CreatedBy = _userService?.UserName; _todoRepo.Add(item.NewToDoITem); return RedirectToAction("index"); }
public IActionResult Index() { _logger.LogInformation("Getting the Items-Info"); _logger.LogDebug("Getting the Items-Debug"); var items= _todoRepo.GetAll(); HomeViewModel hvm = new HomeViewModel { NewToDoITem = new ToDoItem { }, ToDoItems = items }; return View(hvm); }