I\'m trying to load a list of KeyValuePairs from an EF / Linq query like this:
return (from o in context.myTable select new KeyValuePair
Since LINQ to Entities does not support KeyValuePair, you should turns to LINQ to Object by using AsEnumerable first:
KeyValuePair
AsEnumerable
return context.myTable .AsEnumerable() .Select(new KeyValuePair(o.columnA, o.columnB)) .ToList();