开发者

Automatic sorting

开发者 https://www.devze.com 2023-01-22 03:16 出处:网络
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 co

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

精彩评论

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