Rename fields in SubSonic select statement

subsonic

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?

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:

public class Songs

{

private string _songTitle;
public string SongTitle {
    get { return _songTitle; }
    set { _songTitle = value; }
}

public string SongName {
    get { return _songTitle; }
    set { _songTitle = value; }
}

}