I have a context with two entities: one Authority to many Reports (each report has one authority but every authority can have many reports).
I have navigational properties in each of the entities to point to the other entity.
I am trying to write a query to return a list of authorities that is sorted by the amount of reports it has. Since Authority entity has the Reports navigation property which is a list of reports I guess i can ask how many reports are in the list.
Is this possible ? I am new to Linq2Entities and i tried to find an example to do that but couldnt find. Any help would be appreciated.
Thanks.
Sounds like you want something like:
(Possibly
OrderByDescendinginstead.)