這是我所問的代碼示例。當聲明類型不同時,UpdateModel不起作用
public ActionResult Action()
{
object person = new Person(); //It works if i replace object with Person
UpdateModel(person); //this does not update person because of "object" declaring type
return View();
}
如果我在運行時確定模型類型,更新模型的最佳方法是什麼?
看到它 http://stackoverflow.com/questions/7436822/update-model-from-database-does-see-a-type-change – 2013-07-13 04:30:37