2
對NHibernate運行原始SQL,然後使用AutoMapper將它推入List的最佳方式是什麼?NHibernate和AutoMapper
例子:
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;
}