私はEntityframeworkを使用するシステムに取り組んでおり、現在12か月以上にわたってプロジェクトを進めています。昨日までプロジェクトは順調に進んでおり、なぜ発生するのかわからない奇妙なエラーが発生しました。以前に行ったことと何も変わりませんが、問題のエンティティをロードして子エンティティにアクセスしようとすると、次のエラーが発生します。
The entity wrapper stored in the proxy does not reference the same proxy
誰かがこれが実際に何を意味し、何がこれを引き起こすのかについて何か光を当てることができますか?
私のコードを表示しても、実際には役に立ちません。
コードの簡略化されたバージョンは次のとおりです。
var quote = new QuoteHelper().GetById(orderId);
var updatedQuotes = new Provider().GetExportQuotes(quote.DeparturePoint.Id,quote.DestinationPoint);
DeparturePointとDestinationPointにアクセスするとエラーが発生しますが、Quoteが正しく読み込まれ、すべてのプロパティが読み込まれます。
エンティティQuoteは次のようになります。
public class Quote : BaseQuote, ICloneable
{
public Guid DeparturePointId { get; set; }
public virtual LocationPoint DeparturePoint{ get; set; }
public Guid DestinationPointId { get; set; }
public virtual LocationPoint DestinationPoint{ get; set; }
}