Skip to content

Get() call with eager loading not working #6

Description

@pako1337

Hi,
If you will try to do something like

Element element = db.Elements
    .WithContents()
    .Get(ElementId);

you will end up with slightly incorrect query:

select 
"public"."Elements"."ElementId",
"public"."Contents"."ContentId" AS "__withn__Contents__ContentId",
"public"."Contents"."ElementId" AS "__withn__Contents__ElementId",
from "public"."Elements"
LEFT JOIN "public"."Contents"
ON ("public"."Elements"."ElementId" = "public"."Contents"."ElementId")
WHERE "public"."Elements"."ElementId" = ((1))
LIMIT 1 OFFSET 0

Notice LIMIT 1 OFFSET 0 part at the end - only one row will get returned, while I would expect to get all related rows. I.e. eager loading when using Get() (and probably when using First, FirstOrDefault, Single and SingleOrDefault) is broken.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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