There is a ton of info on setting the behavior for delete actions for foreign key relationships in Entity Framework Core, however, I have found nearly zero details on how to specify the "On Update Cascade" constraint of a foreign key.
The closest I have found is this migrations related Microsoft document.
public void Configure(EntityTypeBuilder<Something> builder)
{
builder
.HasOne(s => s.Thing)
.WithMany(t => t.Somethings)
.HasForeignKey(s => s.ThingId)
--> Like Delete behavior, how to set update behavior?
.OnDelete(DeleteBehavior.Cascade);
}
How can this be done with the Fluent API?
DeleteBehavior.SetNull
for optional relationships. – DebugForeignKey(onUpdate: ReferentialAction.Cascade)
But yeah, it's only useful for updates made outside of EF. – Mullion