public ActionResult Edit([Bind(Include = "ID,Title,Content,Prority,Done,CreatedDate,DueDate")] ToDoListViewModel toDoList) { ToDoList UpdatedToDo = new ToDoList(); DataBank db = new DataBank(); UpdatedToDo.ID = toDoList.ID; UpdatedToDo.Title = toDoList.Title; UpdatedToDo.Content = toDoList.Content; UpdatedToDo.CreatedDate = toDoList.CreatedDate; UpdatedToDo.Done = toDoList.Done; UpdatedToDo.DueDate = toDoList.DueDate; UpdatedToDo.Prority = toDoList.Prority; UpdatedToDo.Resource = db.GetResource(toDoList.Resource); if (ModelState.IsValid) { db.EditToDo(UpdatedToDo); return(RedirectToAction("Index")); } return(View(toDoList)); }