Skip to content

Commit

Permalink
Re-write cascade delete documentation
Browse files Browse the repository at this point in the history
Fixes #473
Fixes #828
Fixes #998
Fixes #1926
Fixes #2367
Fixes #2426
Fixes #2906
  • Loading branch information
ajcvickers committed Jan 12, 2021
1 parent 81fd9ab commit 912f9e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions entity-framework/core/saving/cascade-delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ This will result in an exception if the foreign key constraint in the database i
> [!NOTE]
> Databases don't typically have any way to automatically delete orphans. This is because while EF Core represents relationships using navigations as well of foreign keys, databases have only foreign keys and no navigations. This means that it is usually not possible to sever a relationship without loading both sides into the DbContext.
> [!NOTE]
> The EF Core in-memory database does not currently support cascade deletes in the database.
> [!NOTE]
> Do not configure cascade delete in the database when soft-deleting entities. This may cause entities to be accidentally really deleted instead of soft-deleted.
### Database cascade limitations

Some databases, most notably SQL Server, have limitations on the cascade behaviors that form cycles. For example, consider the following model:
Expand Down

0 comments on commit 912f9e9

Please sign in to comment.