ActiveRecord relational order by

295 views Asked by At

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 the persons names. The search should be something similar to this but working

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

There are 1 answers

0
PatrickSteele On BEST ANSWER

I think it's supposed to be:

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