Skip to content

How to avoid the N+1 problem?Β #210

@gebekov

Description

@gebekov

Hi! Thanks for the great library πŸ™‚!

I have a question:
Is there a way to avoid N+1 problems when mapping collections from DTO using transformers/providers (e.g. I keep identifiers in the DTOs and I want them to be loaded from the DB)? Unfortunately I couldn't find a clear answer to my question in the documentation.

The most obvious solution is to retrieve the required objects from the database in advance, before mapping, and pass them to the context. And then pass those objects from the context, but it seems to me that this is not a good solution. Is there another way to map collections?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions