I've read a few articles like this one where it's implied that the necessity of an explicit entity AB between A and B.
When I google this, I can't find any official info confirming nor contradicting that statement. On the other hand, documentation for preview versions might be less than fully covering.
Is it possible in .NET Core 3 or are we still forced to manually create the N-to-N entities?
Many-to-many relationships require a collection navigation property on both sides. They will be discovered by convention like other types of relationships. The way this relationship is implemented in the database is by a join table that contains foreign keys to both Post and Tag .
Keep using EF6 if the data access code is stable and not likely to evolve or need new features. Port to EF Core if the data access code is evolving or if the app needs new features only available in EF Core.
You can use EF Core in APIs and applications that require the full . NET Framework, as well as those that target only the cross-platform .
The feature you (and not only) are asking for is tracked by #10508: Implement many-to-many relationships without mapping join table.
As you can see, the status is Backlog
, which means it is considered, but no concrete schedule. Also the last comment by the EF Core team (manager) is
Current plan for 3.0 is to implement skip-level navigation properties as a stretch goal. If property bags (#9914) also make it into 3.0, enabling a seamless experience for many-to-many could become easier.
Also it's not listed in the New features. And just referenced in Property bag entities
This feature is a stepping stone to support many-to-many relationships without a join entity (issue #1368), which is one of the most requested improvements for EF Core.
where #1368 refers to Discussion on many-to-Many relationships (without CLR class for join table).
All that simply means that the answer to your question is - no, this feature won't be in 3.0, hence you should continue using explicit join entity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With