Wednesday, December 10, 2014

'System.Linq.IQueryable' does not contain a definition for 'Include' and no extension method 'Include' accepting a first argument of type 'System.Linq.IQueryable' could be found

Error: 'System.Linq.IQueryable' does not contain a definition for 'Include' and no extension method 'Include' accepting a first argument of type 'System.Linq.IQueryable' could be found

Solution: Add namespace System.Data.Entity; 
Actually Include is not an extension method on Queryable, so it doesn't come with all the usual LINQ methods. 
If you are using Entity Framework, you need to import namespace System.Data.Entity:

Share This!


1 comment:

Anonymous said...

Hello there, just became alert to your blog through Google, and found that it's really informative.
I'm gonna watch out for brussels. I will be grateful if you continue this in future.
Lots of people will be benefited from your writing.
Cheers!

Powered By Blogger · Designed By Seo Blogger Templates