JonPSmith / EfCore.TestSupport

Tools for helping in unit testing applications that use Entity Framework Core
https://www.thereformedprogrammer.net/new-features-for-unit-testing-your-entity-framework-core-5-code/
Other
352 stars 53 forks source link

Support EF Core 3.1 for .NET Standard 2.0 #38

Closed jahav closed 3 years ago

jahav commented 3 years ago

EF Core 3.1 works on .NET Standard 2.0 (i.e. you can use it along with the .NET Framework).

The library doesn't with .NET Framework 4.7.2 and EF Core 3.1, because the project references EF Core 2.0 for .NET Standard 2.0, although it can use 3.0.

Migration from .NET Framework to .NET Core 5.0 is going to be a long one and it would be good to support framework for some time.

When I tried it, it failed because of different factory methods in 2.0 and 3.1

JonPSmith commented 3 years ago

Hi @jahav,

Yep, sorry about that - here's why it happened. I converted this library as soon as EF Core 3.0 was out and 3.0 required .NET Standard 2.1. Then they downgraded to .NET Standard 2.0 in EF Core 3.1, but my library used the NET standard as the determinate on what version of EF Core it supports.

Going forward with 5.0 I can't make my libraries self-selecting by the .NET Standard any more so I will have to match by version numbers. That's going to be a massive job to redo all my EfCore libraries with different versions and features. And I'm not going to do that until EF Core 5 is out, and I need to finish the update of my book too.

JonPSmith commented 3 years ago

I had a look at this when I was building the EF Core 5 version and I can't fix this easily.