CodeFluent Entities vs Entity Framework: Referential Integrity
Referential Integrity is about guarantee that database constraints are not violated. Databases has different concepts to ensure referential integrity such as foreign keys.
Let’s see what CodeFluent Entities and Entity Framework provides to ensure data and referential integrity!
Entity Framework supports the following concepts:
- Primary keys
- Foreign keys (association)
- On Delete Rule
- Unique constraints aren’t supported with the Model-First approach but are supported by Entity Framework Code First:
CodeFluent Entities supports :
- Primary Keys
- Foreign Keys
You can enforce or not foreign key constraints in the database:
Cascade Save and Cascade Delete can be configured on the save screen and when needed you can set custom rules:
We also support unique constraints:
Note that you can also have compound unique constraints.
Entity Framework and CodeFluent Entities provide mechanisms about referential integrity. Foreign key support is limited with Entity Framework and unique constraint only exists with Code-First
CodeFluent Entities supports unique constraints and it is more flexible thanks to delete and update rules. It allows to set data integrity enforcement.