技术无极限

Nio的技术空间
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

NHibernate 查詢多表返回到IList<Model>中

Posted on 2010-09-23 09:50  Nio  阅读(268)  评论(0编辑  收藏  举报
代码
public IList<TodoListGridData> QueryTodoList(string department)
        {
            IList queryResult 
= this.TradeMeetingDao.GetITradeMeetingGrid(department);

            IList
<TodoListGridData> gridData =
                (from c 
in queryResult.OfType<object[]>()
                 let _Oid 
= Convert.ToString(c[0])
                 let _ModifyDate 
= Convert.ToString(c[1])
                 let _NameEn 
= Convert.ToString(c[2])
                 let _NameLocal 
= Convert.ToString(c[3])
                 let _Status 
= Convert.ToString(c[4])
                 let _Note 
= Convert
.ToString(c[
5])
                 select 
new TodoListGridData
                 {
                     Oid 
= _Oid,
                     ModifyDate 
= _ModifyDate,
                     NameEn 
= _NameEn,
                     NameLocal 
= _NameLocal,
                     Status 
= _Status,
                     Note 
= _Note
                 }).ToList();
}