-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Adding model for Many to Many scenarios #20491
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
.HasMany(e => e.SelfSharedEntityLeftWithPayload) | ||
.WithMany(e => e.SelfSharedEntityRightWithPayload) | ||
.UsingEntity<OneSelfSharedEntityWithPayload>( | ||
r => r.HasOne(x => x.Right).WithMany().OnDelete(DeleteBehavior.NoAction), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndriySvyryd is this how we should configure self many to many? (i.e. the OnDelete part)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if needed
2ff7693
to
6d36cbd
Compare
namespace Microsoft.EntityFrameworkCore.TestModels.ManyToManyModel | ||
{ | ||
// TODO: remove and use shared entity instead | ||
public class OneToTwoSharedEntity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's shared type, not shared entity
Entities: One, Two, Three - regular CompositeKey - entity with composite key Root, Branch, Leaf - inheritance Navigations (all many to many have corresponding navigation on the other side that is not listed here): One - TwoFullySpecified - ThreeFullySpecifiedWithPayload - TwoSharedType - ThreeSharedType - SelfSharedTypeWithPayload - BranchFullySpecified Two - ThreeFullySpecified - SelfFullySpecified - CompositeSharedType Three - CompositeFullySpecified - RootSharedType Composite - RootSharedType - LeafSharedType For now shared type scenarios are not supported in metadata API so we added linking entities temporarily. Those should be removed once the support is in.
6d36cbd
to
2aaaa35
Compare
Entities:
One, Two, Three - regular
CompositeKey - entity with composite key
Root, Branch, Leaf - inheritance
Navigations (all many to many have corresponding navigation on the other side that is not listed here):
One
Two
Three
Composite
For now shared entity scenarios are not supported in metadata API so we added linking entities temporarily. Those should be removed once the support is in.