The Include path expression must refer to a navigation property defined on the type.

Viewed 1611

My linq query

   model.Questions = db.Questions
                     .Where (x => x.CategoriesID == categoryId)
                     .Include (qc => qc.QuestionCounters.Where(x => x.MemberID == User.Identity.GetUserId()))
                     .Include (qf => qf.QuestionFavorites.Where(x => x.MemberId == User.Identity.GetUserId()))
                     .Include (qt => qt.QuestionTags)
                     .ToList();

produces the error

'The Include path expression must refer to a navigation property defined on the type. Use dotted paths for reference navigation properties and the Select operator for collection navigation properties.'

Any ideas why is this happening?

2 Answers
Related