Call is ambigous for Linq methods after LoadWith
See original GitHub issueWhen using LoadWith
and then any Linq method, I’m getting this compilation error (for example for ToArrayAsync
):
CS0121 The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.ToArrayAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Threading.CancellationToken)' and 'LinqToDB.AsyncExtensions.ToArrayAsync<TSource>(System.Linq.IQueryable<TSource>, System.Threading.CancellationToken)'
I’ve written some extension methods to make it unambigous (aka
public static Task<T[]> ToArrayAsyncLinq2Db<T>(this IQueryable<T> set)
{
return LinqToDB.AsyncExtensions.ToArrayAsync(set);
}
But is there a better solution?
Should ILoadWithQueryable
actually implement IAsyncEnumerable
at all?
Environment details
linq2db version: 3.6.0 Database Server: MariaDB Database Provider: Linq2Db.MySQL Operating system: Windows .NET Framework: NET 6.0
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
call is ambiguous between the following methods System. ...
I'm getting an error when I call .ToList(). The call is ambiguous between the following methods or properties: System.Linq.Enumerable.
Read more >Resolving the Call Is Ambiguous Error While Using LINQ
The issue happens when an instance of the class has more than one method with the same name. But how can an instance...
Read more >Fix disambiguity in System.Linq extension methods when ...
error CS0121 : The call is ambiguous between the following methods or properties: 'System.Linq.Queryable.Where(System.Linq.
Read more >The call is ambiguous between two extension methods
Apparently LINQPad is unable to correctly resolve the extension method if it is available either in the same or sub-namespace.
Read more >Ambiguous call when using LINQ extension method on DbSet ...
the described problem is caused by using the system.linq.async package along with the dbset<tentity> class. since dbset<tentity> implements both ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
An update would be appreciated
Yes, he is right,
Assembly System.Linq.Async, Version=6.0.0.0