public ActionResult Edit(int? id)
{
// Attempt to fetch the matching object
var o = m.VehicleGetByIdWithDetail(id.GetValueOrDefault());
if (o == null)
{
return HttpNotFound();
}
else
{
// Create and configure an "edit form"
// Notice that o is a CustomerBase object
// We must map it to a CustomerEditContactInfoForm object
// Notice that we can use AutoMapper anywhere,
// and not just in the Manager class!
var form = AutoMapper.Mapper.Map<VehicleEditForm>(o);
return View(form);
}
}