-
-
Couldn't load subscription status.
- Fork 237
Closed
Labels
Description
When using GroupByMany with a string-based selector that builds a composite key, System.Linq.Dynamic.Core throws “No property or field 'xxxxx' exists in type 'Object'”, while the strongly-typed lambda overload works.
Example to Reproduce
var data = new[] {
new { MachineId = 1, Machine = new { Id=1, Name="A"} },
new { MachineId = 1, Machine = new { Id=1, Name="A"} },
new { MachineId = 2, Machine = new { Id=2, Name="B"} }};
// This doesn't work
data.GroupByMany("new (MachineId, Machine.Name)", "Machine.Id");
// This works
data.GroupByMany(a => new { a.MachineId, a.Machine.Name }, a => new { a.Machine.Id });
I hope the example is helpful, thank you.