What is the best way to run raw SQL against NHibernate, then push it into List using AutoMapper?
Example:
public virtual List<T> GetList<T>(string mainsql)
{
IQuery q = GetSession().CreateSQLQuery(mainsql);
IEnumerable srcAllRows = q.List();
List<T> targetAllRows = new List<T>();
*** do AutoMapper thing to get srcAllRow to targetAllRows ***
return targetAllRows;
}
This is what I ended up with in the do AutoMapper thing section