如果我有以下课程:
public class Foo()
{
public int PropertyIWantUpdated {get; set;}
public int PropertyIDontWantUpdated (get; set}
public ICollection<Bar> Bars {get; set;}
}
Run Code Online (Sandbox Code Playgroud)
保存到我的数据库时,而不是
context.Entry(thisFoo).State = EntityState.Modified;
Run Code Online (Sandbox Code Playgroud)
我正在使用
context.Entry(thisFood).Property(tf => tf.PropertyIWantUpdated).IsModified = true;
Run Code Online (Sandbox Code Playgroud)
如何保存对Bars的更改?
entity-framework ef-code-first entity-framework-ctp5 entity-framework-4.1