Is there a way to rename fields when executing a select statement in SubSonic? I am using the ExecuteTypedList<MyClass> method to fill my List<MyClass> object but the properties of MyClass are not all the same as the column names from the DB table. In SQL I can do select col1 as 'FirstColumn', col2 as 'SecondColumn' from MyTable, is there a way to do something similar in SubSonic?
Rename fields in SubSonic select statement
subsonic
Related Topic
- Subsonic 3.0 and SqlHierachyID
- Select Top N records with Subsonic 3
- TransactionScope, Selects using Subsonic
- Sql – How to select getdate() from subsonic
- Debug a Subsonic Select Query
- How to use a string literal to specify a column name in SubSonic 3.0
- Sql – Subsonic: Select on a View, locks the table update
Best Answer
I believe Alias's are only available for aggregate columns. You could just add properties of the same names as your columns to your class or a partial and map them to the properties you do use ala calculated field:
{
}