EF Core no .Include() method on DBset

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! 🙂

Small, late EDIT: as Christian Johansen pointed out in his comment, the reason it needs the import to see the method signature, is that it is an extension method, which is a topic I strongly encourage any up-and-coming C# developer to learn about as it is immensely useful.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)