LazyLoadingEnabled setting doesn't seem to work in EF 5

后端 未结 3 594
栀梦
栀梦 2021-01-18 23:49

I\'m using EF Model first with POCO entities and with custom DbContexts. My problem is that setting LazyLoadingEnabled=false does not affect anything, navigatio

3条回答
  •  死守一世寂寞
    2021-01-19 00:34

    With the above sample, EF still loads the Programs and OwnerProgram properties of the Program class. I have tried removing the virtual keywords, disabling the proxy creation and also verified that LazyLoadingEnabled=false on the Model itself.

    Am I missing something?

    You need to remove default constructor that initializes these properties.

提交回复
热议问题