次のコードを使用して、オブジェクト コンテキスト内のオブジェクトをデータ ソースのデータで更新します。
public class Project
{
public string Id{get;set;}
public string Name{get;set;}
}
public class People
{
public string Id{get;set;}
public string Name{get;set;}
public IList<Project> ProjectList{get;set;}
}
((System.Data.Entity.Infrastructure.IObjectContextAdapter)Orm).ObjectContext.Refresh(
System.Data.Objects.RefreshMode.StoreWins, people);
人は更新しますが、ProjectList(ナビゲーション プロパティ) は更新しません。問題は、関係を含むオブジェクトを更新する方法です。