public async Task <IActionResult> Delete(long?id) { if (id.HasValue) { return(View(ListsViewModel.GetAList(id.Value, await APIListGetOne(id.Value)))); } return(RedirectToAction("Index", "Home")); }
public async Task <IActionResult> Update(long id, [Bind("ID,Name,IsDone")] ToDoList list) { ListsViewModel lvm = ListsViewModel.GetAList(id, await APIListGetOne(id)); if (ModelState.IsValid) { list.ID = (int)id; await APIListPut(id, list); return(RedirectToAction("Index", "Home")); } return(View(ListsViewModel.GetAList(id, await APIListGetOne(id)))); }