Q: SQL Query variable on Table I'm trying to perform a query on a Table in SQL but the name of the colums to be retrieved is variable, for example:
string[] columns = new string[] { "lastname, firstname, status" };
Dictionary<string, string> columValues = GetColumnValues(userId, columns);

Is LINQ a good option to accomplish it? If so please shed some light on this.
Ps. using Sql Server and c#
thanks,
M0dest0.

A: One thing you can do with EF6 & C# is create a class at runtime which contains your dynamic properties & run an EF6 query with SqlQuery (and create manually the SQL query you need).
search for some examples with this to create a new class at runtime:
https://msdn.microsoft.com/en-us/library/system.reflection.emit.typebuilder(v=vs.110).aspx
EF6 run sql query:
https://msdn.microsoft.com/en-us/data/jj592907.aspx
