This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi All, I have a query that returns a bunch of ReportTypes, each ReportType having several Reports. I have an Aggregate that I use to eager load the Reports (and some other entities linked to each Report). e.g. var query = from r in _uow.ReportTypes this gives me all the ReportTypes in order, but the reports attached to each ReportType are not ordered and I can't see how to do it in the query. I can always do it later by accessing the List of Report objects and then sorting at that stage, but was just wondering if there's another way ?
Cheers Paul
|
|
|
Hi Paul, The way to handle this nicely is to put an OrderBy attribute on the collection. You should end up with a child collection of report objects on your ReportType that looks similar to: [OrderBy("Title DESC")] This means that every time you walk the reports collection it will be ordered by Title in descending order. You can apply this by selecting the relationship in the designer and editing its properties. Hope that helps, John-Daniel |
|
|
Aha. Many thanks for that.I missed that in the docs and didn't get around to asking Ivan yesterday. |
|