Is this possible to create new {variable = x.something} and specify variable name dynamically? For example:
var name = "dynamicName";
var result = context.select(x=> new {name.ToString() = x.something })
In this way we would have a list where property name is dynamicName.
So is this somehow possible?
This is not possible with an anonymous type, because anonymous types are not dynamic. They must be completely defined at compile time. However, you could use a dynamic object like
ExpandoObject: