I have something like the following code you see below as a template.
what are the different ways of doing an update with this record as the way I am doing it below does not work. I am using Entity Framework. C# is used as the language.
public ActionResult Edit(Truck_Mng truck_mng)
{
if (ModelState.IsValid)
{
// what are the different ways you can update the truck_mng record
// I tried what you see below but did not update the record
DataContext.Truck_Mng.Attach(truck_mng);
DataContext.SubmitChanges();
return RedirectToAction("Index");
}
return RedirectToAction("index");
}
I am using Entity Framework.
If
Truck_Mngis a class generated from a table in your database you can do the following:If
Truck_Mnghappens to be a model that you made then you will have to manually map it to the correct table like this:I hope this makes sense.