3

I am having trouble trying to make my models generate like they used to before EF Core. I have tried using both EF Core Power Tools and the scaffold-dbcontext command with no success.

Most answers I've seen on Google => Stackoverflow mentioned many-to-many are now supported in EF6.

  1. Here are my expectations:

enter image description here

  1. But here are the results:

enter image description here

Is there a tool that anyone knows that can help me generate the results in point 1? Or is there perhaps parameters I need to specify when using the scaffolding command? Or select certain options in EF Core Power Tools in order for the extension to generate the models like in point 1?

Thanks in advance...

Morgs
  • 1,558
  • 3
  • 19
  • 34

1 Answers1

2

Scaffolding many to many is coming in EF Core 6, but not implemented yet.

ErikEJ
  • 40,951
  • 5
  • 75
  • 115
  • Hi @ErikEJ, thanks for your reply. I have been using your tool and thought I may've not made the correct selection. Do you know when more or less this feature will become available? – Morgs Jul 14 '21 at 15:02
  • 1
    I am not Erik, but you'll find the answer to your question here: https://github.com/dotnet/efcore/issues/23870 under "General Info". EF Core 6 will most likely arrive with .net 6 in November 2021 (during .net conf 2021 which is scheduled from 9th Nov to 11th Nov). If you need that feature urgently you may want to think about using one of the release candidates of ef core 6. the first one should be due any time soon. they are usually pretty stable) – Jan Jul 14 '21 at 15:38
  • 1
    Hi @Jan - the feature has not been implemented yet, but is planned for EF Core 6. – ErikEJ Jul 14 '21 at 15:51
  • oops, I thought it was in the previews allready?! never mind :) – Jan Jul 14 '21 at 15:55
  • @Jan shocking how something so fundamental was not in EF Core 0.0.0.0.1 in the first place! Weren't such features what made us all run to EF ;( – Morgs Jul 15 '21 at 20:12
  • @ErikEJ I see you released a new update on your EF Core Power tools, does it support scaffolding Many-to-Many relationships now? – Morgs Sep 17 '21 at 13:17
  • @Morgs Yes, it is in the next official release (and the daily build) – ErikEJ Sep 17 '21 at 15:11
  • @ErikEJ thank you for your response. When is the next official release? – Morgs Sep 18 '21 at 16:11
  • @morgs not sure, maybe at RTM of EF Core 6. – ErikEJ Sep 18 '21 at 20:16
  • This is now implemented on EFCore 6 by November 2021. Bare in mind that EFCore6 requires .Net6 – ihebiheb Dec 07 '21 at 03:10