0
我有一个类Foo类型确认的字段UpdateMe如下所述的公共属性..ASP.NET MVC2的UpdateModel不更新包括在白名单
public class Foo
{
public Confirmation UpdateMe{get;set;}
public int BarInt{get;set}
}
public enum Confirmation
{
N = 0,
Y = 1
}
我有了UpdateMe,并运行一个白名单下面的方法...
[AcceptVerbs(HttpVerbs.Post), ValidateAntiForgeryToken]
public ActionResult Update(Foo foo)
{
if(ModelState.IsValid)
{
//this is the Foo as it exists in the backend..using Linq2Sql read/record behavior
Foo existingFoo = _Service.GetFoo();
string[] whitelist = { "UpdateMe" };
UpdateModel(existingFoo, whitelist);
//do persistence stuff down here...
}
}
的模式势必就好了,进入富有任何UpdateMe值我设置,但是程序的UpdateModel没有更新的属性。
这已被荒谬地简化了,但请放心,UpdateModel正在为通过该操作的其他属性工作。
任何想法为什么这个特定的公共财产不更新?