var details= from row in databaseTable
where row.id equals queryId
select new
{
Dict = row.ToDictionary(x => x.Name, x => x.Value),
};
When executing this LINQ to SQL I get the error;
System.NotSupportedException: The
query operator ‘ToDictionary’ is not
supported.
What I need to do is pull the rows into memory first but I’m not sure how. I tried calling ToList in various places but had no luck.
This will work. I think you may have over-simplified your answer though, since in linq-to-sql an item in a table doesn’t implement
IEnumerable<T>