Home > database >  Using Entity Framework what is the difference between Cascade and ClientCascade?
Using Entity Framework what is the difference between Cascade and ClientCascade?

Time:12-22

I am learning C# and how to use Entity Framework. I believe that I know what is Cascade, Restrict, NoAction and SetNull behaviors.

But there are other behaviors with the prefix Client:

enter image description here

I would like to understand what are the difference between them and when should I use ClientCascade instead of Cascade or ClientNoAction instead of NoAction.

CodePudding user response:

the short answer is-- when dependent/ref. entities are loaded/cached in memory, the cascade delete action fails on the main entity - because a CYCLIC ref. LOCK.

ClientCascade allows the DBContext to delete entities even if there is a CYCLIC ref. LOCK

EF Core Cascades vs. Client Cascades Delete

  • Related