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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.1
    • Affects Version/s: 2.1
    • Component/s: LINQ
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 } }");
      

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

                Created:
                Updated:
                Resolved: