开发者

ActiveRecord relational order by

开发者 https://www.devze.com 2023-02-09 08:57 出处:网络
How can I perform I relational order by query? Let\'s say I have a class call Car which has a Property called Person which is another model. Person has a property called name. I want to get all cars b

How can I perform I relational order by query? Let's say I have a class call Car which has a Property called Person which is another model. Person has a property called name. I want to get all cars but order by th开发者_开发百科e persons names. The search should be something similar to this but working

var order = new Order[] { new Order("Person.Name", true) };
return FindAll(order);


I think it's supposed to be:

var order = new Order[] { Order.Asc("Person.Name", true) };
0

精彩评论

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