Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1430

LINQ OfType uses wrong projector when the current projector is a field.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: Linq
    • Labels:
      None
    • Sprint:
      C# Sprint 26

      Description

      var query = CreateQuery()
                      .Select(x => x.C.E)
                      .OfType<V>()
                      .Where(v => v.W == 1111);
      

      Should generated this:

          Assert(query,
                      1,
                      "{ $project: { 'C.E': 1, _id: 0 } }",
                      "{ $match: { 'C.E._t': 'V' } }",
                      "{ $match: { 'C.E.W': 1111 } }");
      

      Rather, it generates this:

          Assert(query,
                      1,
                      "{ $project: { 'C.E': 1, _id: 0 } }",
                      "{ $match: { 'C.E._t': 'V' } }",
                      "{ $match: { 'W': 1111 } }");
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              craiggwilson Craig Wilson
              Reporter:
              craiggwilson Craig Wilson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: