Beispiel #1
0
 public ActionResult Update(EditViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return View("Edit", model);
     }
     var entity = _repository.GetTodo(model.Id);
     entity.Title = model.Title;
     entity.Item = model.Entry;
     _repository.Update(entity);
     return RedirectToAction("Index");
 }
Beispiel #2
0
 public ActionResult Edit(int id)
 {
     var entity = _repository.GetTodo(id);
     var model = new EditViewModel { Id = 1, Title = entity.Title, Entry = entity.Item };
     return View(model);
 }