Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
2.10.0, 2.11.2
-
None
Description
I have a code like this in my ASP.NET Core app
var evtQry = from pe in EventDocCollection.AsQueryable() |
where pe.Create.User.Id == user.Id
|
orderby pe.DateTime descending
|
select pe.Id;
|
var eventIds = await evtQry.Distinct().Take(20).ToListAsync(); |
and it throws the following exception when executed:
System.InvalidOperationException: Extension node must override the property Expression.Type.
|
at System.Linq.Expressions.Expression.get_Type()
|
at MongoDB.Driver.Linq.Expressions.GroupByExpression..ctor(Expression source, Expression keySelector)
|
at MongoDB.Driver.Linq.Processors.Pipeline.MethodCallBinders.DistinctBinder.Bind(PipelineExpression pipeline, PipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable`1 arguments)
|
at MongoDB.Driver.Linq.Processors.MethodInfoMethodCallBinder`1.Bind(PipelineExpression pipeline, TBindingContext bindingContext, MethodCallExpression node, IEnumerable`1 arguments)
|
at MongoDB.Driver.Linq.Processors.PipelineBinderBase`1.BindMethodCall(MethodCallExpression node)
|
Do you have any idea why this exception is thrown? It looks like a problem with the C# driver.