public IActionResult Edit(ListRemindCreate model) { if (ModelState.IsValid) { listService.Edit(model.Id, model.Name, model.ListItems); return(RedirectToAction(nameof(Index))); } return(View(model)); }
public ListRemindCreate GetEdit(int id) { var list = context.ListsRemind .Include(x => x.Items) .SingleOrDefault(x => x.Id == id); var listCr = new ListRemindCreate { Id = list.Id, Name = list.Name, ListItems = list.Items.Select(x => new ListRemindItemCreate { Content = x.Content, }) .ToList(), }; return(listCr); }
public IActionResult Create() { var model = new ListRemindCreate(); return(View(model)); }