Silverlight プロジェクトを 4 から 5 にアップグレードしましたが、DomainContext にデータをロードする場所でコンパイル エラーが発生しました。
Context.Load(Context.GetMyEntityQuery(), LoadBehavior.RefreshCurrent, null, null);
The call is ambiguous between the following methods or properties:
'System.ServiceModel.DomainServices.Client.DomainContext.Load<MyEntity>(System.ServiceModel.DomainServices.Client.EntityQuery<MyEntity>, System.ServiceModel.DomainServices.Client.LoadBehavior, System.Action<System.ServiceModel.DomainServices.Client.LoadOperation<MyEntity>>, object)
'System.ServiceModel.DomainServices.Client.DomainContext.Load (System.ServiceModel.DomainServices.Client.EntityQuery, System.ServiceModel.DomainServices.Client.LoadBehavior, System.Action<System.ServiceModel.DomainServices.Client.LoadOperation>, object)'
これを修正する方法はありますか (そして、そのようなエラーが 100 件以上あります)。
編集
このように呼び出すと役立ちます:
Context.Load<MyEntity>(Context.GetMyEntityQuery(), LoadBehavior.RefreshCurrent, null, null);
原因はこのオーバーロードです (アセンブリ System.ServiceModel.DomainServices.Client.dll、v2.0.5.0)
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual LoadOperation Load(EntityQuery query, LoadBehavior loadBehavior, Action<LoadOperation> callback, object userState);
これと一緒に
public LoadOperation<TEntity> Load<TEntity>(EntityQuery<TEntity> query, LoadBehavior loadBehavior, Action<LoadOperation<TEntity>> callback, object userState) where TEntity : Entity;
後者で十分だと思われるのに、なぜ前者が含まれているのですか?とにかく、さらに調査します(最新のriaサービス1.0 SP2を参照しているようで、すべてをクリーニングし、再構築しても役に立ちません)。