C
C#9mo ago
WAASUL

DeleteBehavior?

I'm always confused which DeleteBehavior to assign when configuring my Entities. Can someone please explain to me?
2 Replies
WAASUL
WAASULOP9mo ago
For instance here
builder.HasOne(e => e.Organization)
.WithMany(e => e.Members)
.OnDelete(DeleteBehavior.Cascade);
builder.HasOne(e => e.Organization)
.WithMany(e => e.Members)
.OnDelete(DeleteBehavior.Cascade);
how do I know which entity is going to get effected. What I mean is that, let's say an organization is deleted, will all the members be deleted. Or does this mean, if a member is deleted, the organization will be deleted?
HtmlCompiler
HtmlCompiler9mo ago
where is the foreign key implemented, Member.OrganzationId? i would say yes to first question, no to second
Want results from more Discord servers?
Add your server