NHibernate Linq中Null值排序的解决方法

在Nhibernate Linq的查询中如何实现Order by Nulls Last 和Order by Null First的功能呢?

方法如下:

OrderByDescending(x => x.Time ?? DateTime.MinValue))

或者

OrderByDescending(x => x.Time ?? DateTime.MaxValue))

posted @ 2013-03-16 17:21  ido  阅读(426)  评论(0)    收藏  举报