Reputation: 9939
from c in Query
select new {User Name = c.UserName};
In LINQ I want to give the named arguments like this but it is not accepting User Name
instead accepting UserName
.
Upvotes: 0
Views: 255
Reputation: 1502626
No, it won't - that's not a valid C# identifier. You can't do that.
Don't try to make the presentation names the same as identifiers. You should use some translation layer to go from property names to labels for the UI, etc.
Upvotes: 5