Why you can't project mapped entity in entity framework
If you have worked with entity framework for a long time with and linq of course, you probably have seen the Error: The entity cannot be constructed in a LINQ to Entities query. So when it happens and why? Think about the following peace of code:
- public IQueryable<Lesson> GetAllLessons(int termId)
- {
- return from p in db.Lessons
- where p.termId == termId
- select ... Continue