Details
-
Bug
-
Resolution: Won't Fix
-
Minor - P4
-
None
-
2.2
-
None
Description
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()