Skip to content

Collection include on nested entity in projection with split Include #22283

Closed

Description

        [ConditionalTheory]
        [MemberData(nameof(IsAsyncData))]
        public virtual Task Include_in_let_followed_by_FirstOrDefault(bool async)
        {
            return AssertQuery(
                async,
                ss => from c in ss.Set<Customer>()
                      let order = ss.Set<Order>().Where(o => o.CustomerID == c.CustomerID)
                        .OrderBy(o => o.OrderDate)
                        .Include(o => o.OrderDetails)
                        .FirstOrDefault()
                      where c.CustomerID.StartsWith("F")
                      select new
                      {
                          c.CustomerID,
                          Order = order
                      },
                elementSorter: e => e.CustomerID,
                elementAsserter: (e, a) => AssertEqual(e.Order, a.Order),
                entryCount: 26);
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

area-queryclosed-fixedThe issue has been fixed and is/will be included in the release indicated by the issue milestone.type-bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions