Support AS column naming
wastaz opened this issue · 1 comments
wastaz commented
Need to support naming of columns in the resultset.
SELECT a.Col1 AS Banana, a.Col2 AS Monkey
FROM Foo a
wastaz commented
Column naming is done via
Select.Column<Person>(p => new { MyCoolName = p.Name }).From<Person>()
Translates into
SELECT PersonRef.Name AS MyCoolName FROM Person PersonRef
Columns being aliased to its original name will not get an unnecessary alias generated for them, however the definition of "unnecessary" is case sensitive.
Select.Column<Person>(p => new { Name = p.Name }).From<Person>()
Translates into
SELECT PersonRef.Name FROM Person PersonRef
However
Select.Column<Person>(p => new { name = p.Name }).From<Person>()
Gives
SELECT PersonRef.Name AS name FROM Person PersonRef