Implementing relations

Dec 10, 2010 at 12:12 PM

@Bertrand - Thanks for the great docs on this topic!

After reading your article I have some questions:

1. I'm just wondering if one can implement relations using Container/Containable/Lists for having the paging functionality by default. Or maybe you could point me in the right direction of how to use the existing pager functionality with existing collections in custom parts? Basically, I have a Recipient list loaded dynamically in NewsletterPart handler OnLoaded event and wish to display them paged.

2. How about loading related content in a part handler (like in Orchard.Roles User-UserRoles-Role n-n relation)? I've implemented parent-child relations by loading corresponding related (by Id) rows from children repository into parent collection in OnLoaded<ParentPart> parent part handler. Is it ok by terms of good-practice and performance or should I rewrite it like shown in docs?

Cheers, Piotr

Dec 14, 2011 at 6:13 PM

Looking forward to this, I've already started thinking about how to address our immediate needs for a site-based newsletter with templates, archiving previous issues, and multiple-page support...

Dec 14, 2011 at 8:05 PM

Pagination is extremely easy to use, and there are many examples throughout the code. There is also some interesting work from Sebastien in projector that goes beyond simple pagination and enables multiple paginated widgets on the same page.

Not sure I understand the second question but what you should really do is profile it to see what requests you're making. It smells like select n+1.