I have a string variable, myFieldname. How can I use its value as a alias in a linq expression?
Collapse
string myFieldname = "theName";
var q = (from d in data select new { d.Id, myFieldname = d.Amount });
I want theName
be the alias not the myFieldname
itself.