Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Support EntityFrameworkCore Many-to-Many Relations #217

Closed
ab-tools opened this issue Sep 21, 2020 · 10 comments
Closed

Support EntityFrameworkCore Many-to-Many Relations #217

ab-tools opened this issue Sep 21, 2020 · 10 comments
Labels
question Requesting information

Comments

@ab-tools
Copy link

Hello Michael,

just wanted to give the EntityFrameworkCore another try on the weekend as in 5.0.0-rc.1 there are now obviously - finally - many-to-many relations available in EntityFrameworkCore as well:
dotnet/efcore#19003

After updating the project to .NET 5.0.0-rc.1 and downloading the very latest version of EFDesigner, when I try to switch an entity model from "EF6" to "EFCore" in the designer I still get the message that many-to-many relations would not be supported in EntityFrameworkCore.

Is that something you plan to support anytime soon?
It's so cool that finally EntityFrameworkCore supports obviously many-to-many relations as well - which was the only thing preventing me to switch over from EF6 so far. Therefore, it's really a pity that EFDesigner seems to block this transition now.

Just let me know in case you would have a pre-release version or so to try with support for that!

Thanks a lot
Andreas

@ab-tools
Copy link
Author

ab-tools commented Sep 21, 2020

... just noticed that you have a nice "EFCore5.x" branch already, @michael-sawczyn! :-)

Tried to compile that myself for a try, but had a hard time to generate the VSIX file:
If you could therefore create a pre-release (or just add the VSIX file to this branch in the "dist" folder) that would be great - then I could give it a try already. Thanks!

@msawczyn
Copy link
Owner

Hi Andreas,

It's not quite ready for pre-release, but creating a file in dist when checking in isn't a bad idea. Now, if I can just remember to do that, since it only does that when I compile the Release version :-)

@msawczyn msawczyn added the question Requesting information label Sep 23, 2020
@ab-tools
Copy link
Author

Thanks for the quick reply as always, @michael-sawczyn! :-)

If it "generally works" already would be cool if you could push a VSIX file to that branch as I really would like to give EF Core a try, but at the moment I simply can't generate my model files without your great product. ;-)

@msawczyn
Copy link
Owner

That branch now has a nightly build in the dist directory. Note, though, that it's far from done or well tested yet.

@ab-tools
Copy link
Author

Thanks, @michael-sawczyn, just did a quick try and this is working pretty nice already actually!

I've only found two issues so far and could resolve the first one myself:

  1. Compiling transformation: 'Multiplicity' is an ambiguous reference between 'Sawczyn.EFDesigner.EFModel.Multiplicity' and 'Microsoft.VisualStudio.Modeling.Multiplicity' Miscellaneous Files c:\program files (x86)\microsoft visual studio\2019\preview\common7\ide\extensions\iaom5frb.po2\TextTemplates\EFCoreDesigner.ttinclude 475: I simply added Sawczyn.EFDesigner.EFModel. on all occurrences in that file which fixed the problem.

  2. Many-to-many relations are working great now, with the exception that it does not yet like a many-to-many relation to itself yet like this:
    image
    This generates in code something like

      modelBuilder.Entity<global::Data.Item>()
                  .HasMany(x => x.Linked)
                  .WithMany();
    

which is invalid (as no argument to WithMany() is provided). But I guess you are aware of this already.

In case you would like me to test something, just let me know - really looking forward to get this fully working with EFCore many-to-many relations! :-)

Thanks
Andreas

@ab-tools
Copy link
Author

ab-tools commented Nov 1, 2020

Hello Michael,

just wanted to carefully ask if you made some progress with the EF Core 5.0 support already? :-)

As I understand Microsoft plans to push .NET 5.0 including EF Core 5.0 out officially this month and looks like there won't be any major changes to it anymore till then. Really looking forward to use the EF Designer also with EF Core 5.0 (especially in regards to the many-to-many support)! ;-)

Thanks as always for your great work
Andreas

@msawczyn
Copy link
Owner

msawczyn commented Nov 2, 2020 via email

@ab-tools
Copy link
Author

ab-tools commented Nov 3, 2020

That's great to hear, Michael, looking forward to it! :-)

@ab-tools
Copy link
Author

ab-tools commented Nov 5, 2020

After I noticed that you have added a new nightly build yesterday I needed to give it a try, of course!

Not fully working for me yet (also after removing the displaced this.), but I guess it's still to early to provide feedback:
Just let me know when you want to hear about initial test results. 😉

@msawczyn
Copy link
Owner

v3.0 released today.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Requesting information
Projects
None yet
Development

No branches or pull requests

2 participants