public IActionResult Edit(int id) { var model = new AListViewModel(); if (id > 0) { model = ListDbManager.OneList(id); model.Message = "Item Count: " + model.Items.Count; } return(View(model)); }
public IActionResult Edit(int id, AListViewModel model) { if (ModelState.IsValid) { AList toSave = model; toSave.ID = id; ListDbManager.SaveList(toSave); return(RedirectToAction("Show", new { id = id })); } model.Message = "Item Count: " + model.Items.Count; return(View(model)); }