-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
System.Linq.Dynamic.Core.DynamicQueryableExtensions.AsEnumerable conflicts with System.Linq.Enumerable.AsEnumerable #304
Comments
If you want to apply the logic from this library on an IEnumerable, just to a AsQueryable() and continue to use this library. |
The problem I've run into is I have a class that makes use of both this library and System.Linq. In this class, I make use of System.Linq.AsEnumerable() to "switch" from an EF (IQueryable) query to a (IEnumerable) Linq-to-Objects query, but I cannot do that if the class also uses System.Linq.Dynamic.Core as it's .AsEnumerable() extension results in the error noted above. |
Just call the var result = System.Linq.Dynamic.Core.DynamicQueryableExtensions.AsEnumerable(x); |
Thanks. That's what I ended up doing but hoped there would be a better workaround (similar to what MoreLinq does). These are very large queries with multiple chained calls so having to break the query up to work around an ambiguous extension method issue is not ideal. |
This is quite a big usability issue. With It could be worth considering redesigning this API to co-exist with |
+1 - even though this is an old issue, still affecting me today when upgrading old codebases to ef6. |
@pgaske & @slang25 & @jbagley-iona I'll rename the extension method to A new version will be released within a few days. |
I've run into an issue where the System.Linq.Dynamic.Core.DynamicQueryableExtensions.AsEnumerable extension method conflicts with the System.Linq.Enumerable.AsEnumerable extension method:
I think this will become a more common issue with the upcoming release of EF Core 3.0 (where it will be necessary to explicitly force the enumeration of DB queries to avoid exceptions if they cannot be translated completely to SQL).
MoreLinq has similar issues and outlines a workaround in their documention (https://github.com/morelinq/MoreLINQ/blob/v3.1.0/README.md#usage). Would it be possible to do something similar in System.Linq.Dynamic.Core?
The text was updated successfully, but these errors were encountered: