IQueryable does not contain a definition for 'Include' and no extension method 'Include'

后端 未结 6 1895
离开以前
离开以前 2020-12-13 23:32

I\'m trying to use Include extension on IQueryable set, but I have the following issue:

Error 1 \'System.Linq.IQueryable<.Model.InsuranceCaseType

6条回答
  •  盖世英雄少女心
    2020-12-14 00:13

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

    using System.Data.Entity;
    

提交回复
热议问题