Mongo Driver Compatibility
Azaferany opened this issue · 3 comments
Details
Version
2.7.4
Details
Hi, i to want use this package on MongoDB .NET Driver and all functionalities except Filtering work as it should.
i use ApplyFiltering
on IQueryable
and mongo driver throw below exception
System.ArgumentNullException: Value cannot be null. (Parameter 'itemName')
at MongoDB.Driver.Core.Misc.Ensure.IsNotNull[T](T value, String paramName)
at MongoDB.Driver.Linq.Linq2Implementation.Expressions.WhereExpression..ctor(Expression source, String itemName, Expression predicate)
at MongoDB.Driver.Linq.Linq2Implementation.Processors.BinderHelper.BindWhere(PipelineExpression pipeline, IBindingContext bindingContext, LambdaExpression lambda)
at MongoDB.Driver.Linq.Linq2Implementation.Processors.Pipeline.MethodCallBinders.WhereBinder.Bind(PipelineExpression pipeline, PipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable1 arguments) at MongoDB.Driver.Linq.Linq2Implementation.Processors.MethodInfoMethodCallBinder
1.Bind(PipelineExpression pipeline, TBindingContext bindingContext, MethodCallExpression node, IEnumerable1 arguments) at MongoDB.Driver.Linq.Linq2Implementation.Processors.PipelineBinderBase
1.BindMethodCall(MethodCallExpression node)
at MongoDB.Driver.Linq.Linq2Implementation.Processors.PipelineBinderBase1.Bind(Expression node) at MongoDB.Driver.Linq.Linq2Implementation.Processors.Pipeline.PipelineBinder.Bind(Expression node, IBsonSerializerRegistry serializerRegistry) at MongoDB.Driver.Linq.Linq2Implementation.MongoQueryProviderImpl
1.Prepare(Expression expression)
at MongoDB.Driver.Linq.Linq2Implementation.MongoQueryProviderImpl1.Translate(Expression expression) at MongoDB.Driver.Linq.Linq2Implementation.MongoQueryProviderImpl
1.Execute(Expression expression)
at MongoDB.Driver.Linq.Linq2Implementation.MongoQueryableImpl2.GetEnumerator() at System.Collections.Generic.List
1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source)
at .Infrastructure.RouteRepository.Find(GridifyQuery query) in /Users/almas/Desktop/.Infrastructure/RouteRepository.cs:line 25
this exception happened when lambda Parameters Name is null on where
i look at CreateExpression
method on GridifyMapper
i think if on
Gridify/src/Gridify/GridifyMapper.cs
Line 172 in 2230e4a
fill Expression Parameter Name by
nameof(T)
it will do the work
var parameter = Expression.Parameter(typeof(T), nameof(T));
Hi @Azaferany,
Good catch! thanks,
It is fixed in v2.7.5
.
it fixed
now all function work perfect for mongo driver 🤩
i think its worth to metion mongo driver usage on docs
thanks,
now all function work perfect for mongo driver 🤩
Great 👍
i think its worth to metion mongo driver usage on docs
feel free to send a pull request 😉