NHibernate + Paging + Order

I am not quite sure of the most elegant decision of what I am trying to do.

I have a page that lists music lists, there can be thousands of them, so they are downloaded in batches of 20, I also have 4 links at the top of the page to change the order of these lists.

Sorting by properties can be located on different objects, such as Audio.AudioStats.NumComments or Audio.Artist.NumProfileViews.

I use the repository template and service level. My controllers can only access the service level, and then the service level accesses my repositories.

I can do the paging quite easily, just transfer my current page and page size to my data level ... but how could I calmly allow the user to choose the order of my objects.

I use S # arp Architecture 1.5.2 if that matters.

Thanks in advance.

+5
source share
1 answer

You will need to somehow match the wishes of users with the order of the proposal.

Presumably, you are doing something like skip(n).take(m), which will also require a proposal orderby().

, () , , orderby().

, , ( Sortby.ArtistProfileViews - ). , .

+1

All Articles