public async Task <IActionResult> Edit(TodoItemEditModel model) { var todoItem = await _services.GetByIdAsync(model.Id); todoItem.Title = model.Title; todoItem.IsCompleted = model.IsCompleted; _services.EditAsync(todoItem).Wait(); return(RedirectToAction("Index")); }
private TodoItemEditModel ToEditModel(TodoItem item) { var model = new TodoItemEditModel { Id = item.Id, Title = item.Title, IsCompleted = item.IsCompleted }; return(model); }