EF Core no .Include() method on DBset

后端 未结 3 881
醉梦人生
醉梦人生 2021-02-12 12:30

I\'m currently completely unable to call .Include() and intellisense (in vscode) doesn\'t seem to think it exists.

Now after a long time searching the web I\'ve found th

3条回答
  •  孤独总比滥情好
    2021-02-12 12:52

    It's a direct consequence of a missing reference in the file where I'm making a call to the method (though i'm not quite sure i understand how...)

    Anyways, adding:

    using Microsoft.EntityFrameworkCore;
    

    like Tseng and Smit suggested, did the trick. (in the file in which i define the function)

    Though why that works i have no idea. I thought .include would automatically be available through the DbSet.

    Thanks though! :)

提交回复
热议问题