I need to compare the in-memory tuples with table. I tried with the following query and it is not working,
var tuples = new List<Tuple<string, int>>()
{
new Tuple<string, int>("12222",1),
new Tuple<string, int>("12222",2)
};
var result = Context.infotable
.Where(i => tuples.Any(t => t.Item1 == i.col1 && t.Item2 == i.col2)
.ToList();
Following exception is thrown:
Unable to create a constant value of type 'System.Tuple`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'. Only primitive types or enumeration types are supported in this context.
var result = ...
line. I'd suggest pasting the exact code you used. – smead