I'm very noob when it comes to ASP.NET MVC.
I'm looking at the starter example from the ASP.NET MVC add-in.
I see something like this was automatically generated:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(int id, FormCollection collection)
{
try
{
// TODO: Add update logic here
return RedirectToAction("Index");
}
catch
{
return View();
}
}
I find this stinks because I want to use the Entity Framework where entity state will be conserved. I would like something similar to:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(Person person)
{
try
{
// TODO: Add update logic here
return RedirectToAction("Index");
}
catch
{
return View();
}
}
Notice I took out FormCollection and replaced it with the Person class. - I would like this to avoid magic strings. - Conserve entity states. - More explicit.
Is this even possible?
/confused with MVC