Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Smith 21 posts 103 karma points
    Aug 11, 2020 @ 18:52
    Gordon Smith
    0

    Efficient way to query documents and media using relations

    Developing a business directory.

    Members can list multiple businesses and each business can have n media and 1 default media photo.

    What's the most efficient to query Umbraco to get a list of Businesses and their default media to show in a list?

    I am thinking that Umbraco relations might be the way to go but haven't got a clue how to use Linq to efficiently query Umbraco to get the list of businesses and their related media.

    Can anybody post some pseudocode?

    Thanks in advance.

  • Amir Khan 1287 posts 2744 karma points
    Aug 11, 2020 @ 21:01
    Amir Khan
    0

    Are you trying to list the business by member or could you just query them by document type and return all of the businesses?

  • Gordon Smith 21 posts 103 karma points
    Aug 12, 2020 @ 08:15
    Gordon Smith
    0

    Hi Amir

    Actually both.

    On the members' personal page I will need to display the businesses for that particular member together with their related media.

    In other parts of the site (e.g., the business category pages) I'll need to display a list of the businesses by any member (again with their related media).

    I think of it like a SQL left join I need to do between businesses and their related media. I know how to do it in SQL but not in Umbraco with relations.

    It's the relational aspect of this task that is foxing me.

    Many thanks, Gordon

Please Sign in or register to post replies

Write your reply to:

Draft