Skip to content

[Query] Include should be wrapped around only the first parameter #15783

Open

Description

var orders
                    = useString
                        ? context.Set<Order>()
                            .Include("Customer")
                            .Select(o => new
                            {
                                o,
                                O2 = o,
                                C = o.Customer
                            })
                            .ToList()
                        : context.Set<Order>()
                            .Include(o => o.Customer)
                            .Select(o => new
                            {
                                o,
                                O2 = o,
                                C = o.Customer
                            })
                            .ToList();

There are 2 IncludeExpression and both of them are different object so cannot dedupe them easily either. We tend to avoid materialization twice. Doing include twice on same object is even worse.

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions