Using GetType in Group throws instead of translating to _t

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.2
    • Component/s: LINQ
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There's no to use Group (and probably other aggregations) with anonymous types to generate a projection for the discriminator (i.e. _t).

      For example this works:

      collection.Aggregate.Group(x => new { Name = x.Name }, g => new { Count = g.Count() }
      

      But grouping on the document type:

      collection.Aggregate.Group(x => new { Type = x.GetType }, g => new { Count = g.Count() }
      

      throws an exception with the following message:

      GetType of type System.Object is not supported in the expression tree document.GetType()

              Assignee:
              Unassigned
              Reporter:
              Bar Arnon
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: