Why is EF returning a proxy class instead of the actual entity?

后端 未结 6 1463
时光取名叫无心
时光取名叫无心 2020-12-02 20:24

I\'m having trouble with entity framework returning Proxies when I want the actual entity class. The first time I run my code everything runs properly (no proxies), but eve

6条回答
  •  有刺的猬
    2020-12-02 21:11

    In my case this issue was fixed by setting Lazy Loading Enabled to false.

    1. Open the .edmx (diagram)
    2. Hit F4 to bring up the properties
    3. Set Lazy Loading Enabled to false
    4. Save and rebuild

提交回复
热议问题