public ActionResult Create(TodoList todolist)
        {
            if (ModelState.IsValid)
            {
                db.TodoList.Add(todolist);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(todolist);
        }
示例#2
0
 private bool Equals(TodoList other)
 {
     return(Equals(TodoElements, other.TodoElements));
 }
        public ActionResult Edit(TodoList todolist)
        {
            if (ModelState.IsValid)
            {
                db.Entry(todolist).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(todolist);
        }