I’m looking for way to get something like this:
string _col1 = "first name";
string _name;
var query = from c in ctx.Customers select c;
_name = query.FirstOrDefault().[_name];
As far as I can see I can only get strongly typed field names but I would like to provide them as string variables.
I’m not sure if EF provides you with a way to get a property value based on the string name of the property, but you can use reflection.
I’m guessing the EF class you’re dealing with is called
Customer.