I'm trying to get query like this from LINQ/EF6 in C#
SELECT "ID_column"
FROM "Entity"
WHERE ("ColumnA","ColumnB") IN (('Value_0_0','Value_0_1'),('Value_1_0','Value_1_1'), ...);
But I'm getting the following error for the code bellow
Unable to create a constant value of type 'Anonymous type'. Only primitive types or enumeration types are supported in this context.
context.Entities
.Where(e => values.Any(v => v.ColumnA == e.ColumnA && v.ColumnB == e.ColumnB))
.Select(e => e.ID_column);
or
context.Entities
.Where(e => values.Contains(new {e.ColumnA, e.ColumnB}))
.Select(e => e.ID_column);
Is there any way how to select multiple columns from table based on different set of multiple columns from the same table in one query using LINQ?
I know there is a lot of questions related to the error I get, but I didn't find any related to multiple columns or how to solve this.