예제 #1
0
 public IActionResult Add(HomeViewModel item)
 {
     item.NewToDoITem.CreatedDate = DateTime.Now;
     item.NewToDoITem.CreatedBy = _userService?.UserName;
     _todoRepo.Add(item.NewToDoITem);
       return RedirectToAction("index");
 }
예제 #2
0
 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);
 }