Closed GioviQ closed 3 years ago
Thanks for reporting this. Looks like we have work to do for .NET 5.
I've just taken a local copy of the Breeze.Persistence.EFCore files for a tentative upgrade of our project to .net5 / EF Core 5 and found that the changes needed are minimal, at least for our use of Breeze. I know I should provide a pull request but I also realise that there's a lot more to it than just a couple of code changes - such as backward compatibility, tests etc etc. I don't claim to have done any more than check that it saves edits on single entities in our particular code base. However, in case anyone is interested I'll list the changes here:
EFPersistenceManager.cs
change 2 occurrences of Metadata.GetTargetType()
... to Metadata.TargetEntityType
... here https://github.com/Breeze/breeze.server.net/blob/cbccd05c95e6c64058d8e1043ec426f0894f21f3/AspNetCore/Breeze.Persistence.EFCore/EFPersistenceManager.cs#L218 and here https://github.com/Breeze/breeze.server.net/blob/cbccd05c95e6c64058d8e1043ec426f0894f21f3/AspNetCore/Breeze.Persistence.EFCore/EFPersistenceManager.cs#L311MetadataBuilder.cs
.GetTargetType()
to .TargetEntityType
np.IsScalar = !p.IsCollection();
to np.IsScalar = !p.IsCollection;
. Line 123p.IsDependentToPrincipal()
to p.IsOnDependent
. Line126var invP = p.FindInverse();
to var invP = p.Inverse;
. Line 130I'm not sure if the changes are required specifically for .net5 or rather for EF Core 5. I think, probably, the latter but haven't checked. The changes are enough to get everything working as expected in our application. YMMV.
In the immortal words of many a time constrained developer - "if it compiles, ship it" ;-)
In future I think I will use https://github.com/ChilliCream/hotchocolate because It is not clear the Breeze roadmap.
.NET 5 versions have been published.
All of the below now have a version 5.0.2... or later
Breeze.AspNetCore.NetCore Breeze.Core Breeze.Persistence Breeze.Persistence.EFCore
These are all based on .NET 5 and the EFCore is based on EFCore 5.
An exception of type 'System.MissingMethodException' occurred in Breeze.Persistence.dll but was not handled in user code Method not found: 'Microsoft.EntityFrameworkCore.Metadata.INavigation Microsoft.EntityFrameworkCore.ChangeTracking.NavigationEntry.get_Metadata()'.
This happens after .Net 5 Migration