This question is similar to this question but not quite the same.
Can I make a dynamic query on a linq-to-sql data context and have the result return as an IDictionary<string, object> where the key is the name of the column?
A bit like so (doesn't compile, but illustrates the intention)
IDictionary<string, object> data = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
data = db.ExecuteQuery<IDictionary<string, object>(queryString, params).ToDictionary(
k=>nameOfColumn,
k=>k
)
Obviously I'm totally off the map in the data = db.ExecuteQuery...
I have the feeling that the executeQuery is not what I'm ought to use as this one already tries to do the mapping to an object. For this particular use case I don't want that.