LINQ, Unable to create a constant value of type XXX. Only primitive types or enumeration types are supported in this context

前端 未结 5 642
我寻月下人不归
我寻月下人不归 2020-11-30 01:58

In my application I have Lecturers and they have list of Courses they can teach and when I\'m deleting a course I want to remove connection to lecturers. Here\'s the code:

5条回答
  •  余生分开走
    2020-11-30 02:51

    This can also happen when you pass a Func to Where() as a way to write a dynamic condition like here here For some reason the delegate can't be translated to SQL.

提交回复
热议问题