I have a SQL Serve table that contains two fields, date of type System.DateTime
and id of type int
I also have a collection of objects in a list which contain the same structure or data and I am looking to extract the matches from the database
var itemsToDelete = db.RecordsTable.Where(
dbRecord => myList.Any(
item => item.PhysicalID == dbRecord.PhysicalId && item.date.Equals(dbRecord.date)
)
);
However, when I run this it throws an exception of "Unable to create a constant value of type 'RecordsTable'. Only primitive types or enumeration types are supported in this context."
What am I missing?