Will work on a PR when got the time, just posting here for the record.
DynamicClassFactory.CreateType() will create a DynamicType with a "duplicate" constructor when the type has no properties and createParamterCtro = true.
This breaks later code when they try to find the constructor implementation.
I found this when doing:
var countQuery = query;
if (this.GroupBy != null)
{
countQuery = countQuery.GroupBy(
CustomParsingConfig.ParsingConfig,
this.GroupBy.KeySelector.Expression,
"new()");
}
result.Count = countQuery.Count();
Here I am using a dummy new() for the projection because I only want to count the results.
As a workaround, I replaced "new()" with "1", but still the bug is there.
The problem is when names.Length = 0:

The solution is to not create the second constructor if the type has no parameteres.
Will work on a PR when got the time, just posting here for the record.
DynamicClassFactory.CreateType() will create a DynamicType with a "duplicate" constructor when the type has no properties and createParamterCtro = true.
This breaks later code when they try to find the constructor implementation.
I found this when doing:
Here I am using a dummy new() for the projection because I only want to count the results.
As a workaround, I replaced "new()" with "1", but still the bug is there.
The problem is when names.Length = 0:
The solution is to not create the second constructor if the type has no parameteres.