I was wondering if there is a way to name or rename a property of an anonymous type to include a space in the property name. For instance:
var resultSet = from customer in customerList
select new
{
FirstName = customer.firstName;
};
In this example, I would like FirstName to be "Name". The reason for this question is because I have a user control that exposes a public DataSource property that I associate with another anonymous type. It works fine right now, except that one small drawback of column names is slightly less than user-friendly (FirstName instead of name).
source
share