By debugging I could see it updates old entry with my new model entry. However it doesn’t save changes, although I called the submit changes method.
public ActionResult EditGameDetails(artikel model){
artikel old = myShop.artikels.Single(m => m.artikelnummer == model.artikelnummer);
old = model;
myShop.SubmitChanges();
return RedirectToAction("Games","Game");
}
Have I forgotten any codes?
You can’t simply set old to model because these are two different instances of the object. The one bound to the actionresult is not being tracked by your ORM. The following should work.
You can also use a tool such as automapper if you don’t want to manually type all the property assignments.