question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Call is ambigous for Linq methods after LoadWith

See original GitHub issue

When 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:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Evengardcommented, May 31, 2022

An update would be appreciated

0reactions
Evengardcommented, Apr 13, 2022

Yes, he is right, Assembly System.Linq.Async, Version=6.0.0.0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found