Dynamic Content Relationships
Imagine the scenario whereby I have a dynamic module that has types 'A' and 'B' and A has a related data field to items of type B. In code, I can easily get the related items from A by calling 'GetRelatedItems'. However, in code I would like to get the items of type A that are related to an instance of B. The only way I can see to do this would be to get all items of type 'A', get their related items of type 'B' and check whether any of them are the same as my current instance of B. This seems very expensive. Is there anyway to get the parents of a child item?
I would also like some clarification on this. Right now, I'm using SQL queries and Domain Models, but it would be great to use the API, especially for localization where direct SQL isn't really a good option.
Hi folks,
I think there's an example of that exactly within the Sitefinity documentation.
There's also a video that includes an exactly that case:
youtu.be/WVKasAtZZYk
Hope that helps!
Regards,
Grisha 'Greg' Karanikolov
Telerik