anthonyreilly / NetCoreForce

Salesforce REST API toolkit for .NET Standard and .NET Core
MIT License
110 stars 63 forks source link

Microsoft.EntityFrameworkCore and System.Linq namespace conflict #29

Closed anthonyreilly closed 3 years ago

anthonyreilly commented 3 years ago

Apps using this, Microsoft.EntityFrameworkCore and System.Linq at the same time may see these errors, or similar:

error CS1061: 'DbSet' does not contain a definition for 'Where' and no accessible extension method 'Where' accepting a first argument of type 'DbSet' could be found (are you missing a using directive or an assembly reference?)

Due to a namespace conflict in Microsoft.EntityFrameworkCore and System.Linq, as the new System.Interactive.Async places some extension methods in System.Linq.

https://github.com/dotnet/efcore/issues/18124

This issue is due mostly to System.Interactive.Async - solving it may require removing async support in 3.0 or using an alternate method for processing async result batches.

anthonyreilly commented 3 years ago

Looking at removing the use of System.Interactive.Async entirely, and using the native async streams: https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/generate-consume-asynchronous-stream Appears to be possible to include this for netstandard2.0 clients via the Microsoft.Bcl.AsyncInterfaces package https://www.nuget.org/packages/Microsoft.Bcl.AsyncInterfaces/

anthonyreilly commented 3 years ago

removed System.Interactive.Async entirely, and switched to using the native async streams. included in v3 Beta 2 https://www.nuget.org/packages/NetCoreForce.Client/3.0.0-Beta2

Linq package still has a reference to System.Interactive.Async, but that can be removed later as it doesn't impact the primary packages.