Shadow property read via EF.Property in a client-side join projection materialises as null

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 10.0.3, 9.1.3, 8.4.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Dotnet Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      When a LINQ query joins two entity sets and the final projection reads a shadow property of a joined entity via EF.Property<T>(...), the provider returns the correct rows and correctly materialises the joined entities, but the shadow-property value in the projection comes back null instead of its stored value.

      The value is stored and is read correctly on a normal entity load — the defect is isolated to the client-side shaper for the projection, not storage, not the driver.

      This shape previously threw ExpressionNotSupportedException on C# driver 3.9.0 (the join-with-subquery inner was not translated), so the bug was not observable until the driver upgrade to 3.10.0 made the query translate. It is a pre-existing provider shaper gap, not a regression introduced by the driver bump.

      Steps to reproduce

      EF Core specification test NorthwindJoinQueryTestBase.Join_customers_orders_with_subquery_anonymous_property_method:

      from c in ss.Set<Customer>()
      join o1 in
          (from o2 in ss.Set<Order>()
           orderby o2.OrderID
           select new { o2 }) on c.CustomerID equals o1.o2.CustomerID
      where EF.Property<string>(o1.o2, "CustomerID") == "ALFKI"
      select new
      {
          o1,
          o1.o2,
          Shadow = EF.Property<DateTime?>(o1.o2, "OrderDate")   // <-- comes back null
      }
      

      Expected

      Shadow equals the joined order's OrderDate (e.g. Order 10643 -> 1997-08-25), matching LINQ-to-Objects.

      Actual

      Shadow is null for every row. Row count and the o1 / o1.o2 entity projections are correct.

            Assignee:
            Damien Guard
            Reporter:
            Damien Guard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: