Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error (1.0.8.3 to 1.0.8.4 on EF 6.2) "No generic method 'OrderBy' on type System.Linq.Queryable" #161

Closed
AndersMad opened this issue Apr 27, 2018 · 6 comments

Comments

@AndersMad
Copy link

I use Roslyn to dynamically compile script with dynamic queries in it (on EF 6.2 @ .NET 4.7.1) - and after updating to 1.0.8.4 (from 1.0.8.3) I get this error on 2. compile (first is ok):

Error: No generic method 'OrderBy' on type 'System.Linq.Queryable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic. :

Stack:

System.Linq.Expressions.Expression.FindMethod(Type type, String methodName, Type[] typeArgs, Expression[] args, BindingFlags flags)
System.Linq.Expressions.Expression.Call(Type type, String methodName, Type[] typeArguments, Expression[] arguments)
System.Linq.Dynamic.Core.DynamicQueryableExtensions.OrderBy(IQueryable source, String ordering, Object[] args)
System.Linq.Dynamic.Core.DynamicQueryableExtensions.OrderBy[TSource](IQueryable`1 source, String ordering, Object[] args)
@StefH
Copy link
Collaborator

StefH commented Apr 27, 2018

This is indeed strange. Are you sure it's caused by the new version (1.0.8.4) ?

Can you provide an example project with some more details?

@AndersMad
Copy link
Author

Yes, I'm sure its the version - maybe somehow its the (now static) class PredefinedTypesHelper ctor and its static data - or the missing #if NETSTANDARD2_0 etc. in the try-add section?

I will investigate more at a later time (haven't got that time right now) and create a repro. For now I'll just have to switch back.

@AndersMad
Copy link
Author

Or more likely its the new ParameterExpressionHelper.CreateParameterExpression that cache on source.ElementType - but if its a wrapper and/or anonymous type it conflicts?

@StefH
Copy link
Collaborator

StefH commented Apr 27, 2018

Thanks for reporting, for now I've unlisted the package from NuGet and will investigate.

@StefH
Copy link
Collaborator

StefH commented Apr 27, 2018

The PredefinedTypesHelper could not be the issue, because I use a try-catch to find a type, and if it's not found, it's not added. However, I did add the if-def again.

The ParameterExpressionHelper could be the issue.

I did upload new NuGet : 1.0.8.5

@AndersMad
Copy link
Author

Thanks, 1.0.8.5 works!

@StefH StefH closed this as completed Apr 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants