开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜