Automatic sorting
Is it possible to get nhibernate to sort lists on a specific property/column (if no sorting开发者_StackOverflow社区 have been specified)? Maybe in the mapping files or in some other way?
you can use code below :
Session.CreateCriteria(typeof(ICustomer)) .AddOrder(Order.Desc("name") ) .List();
Not possible as of today.
would like something like:
<nhibernate-mapping>
<class default-order-by="Name">
<property name="Name" column="name" />
</class>
</nhibernate-mapping>
精彩评论