Any of those help 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: , You can't use Contains with non-primitive values. Do
this will help I suspect that the problem is that you are using a complex type in your query for comparison f.UpFile.Equals(upFile) Why don't you try comparing by a primitive type such as the upFile id for example?
var fields = from f in db2.Fields
where f.UpFile.ID == upFile.ID
ViewBag.Fields = fields.ToList();
Unable to create a constant value of type 'AddressModel'. Only primitive types or enumeration types are supported in thi
I wish this help you That is because childContactAddress object (and also taxReceiptChargesModelList) is already in memory and when you try to assign a complex object in the projection of your second query, the Linq provider can't translated that object to SQL. One option can be call AsEnumerable extension method: