https://github.com/arnab-developer/ef-inheritance
Default, TPT and TPC demo
https://github.com/arnab-developer/ef-inheritance
Last synced: about 1 month ago
JSON representation
Default, TPT and TPC demo
- Host: GitHub
- URL: https://github.com/arnab-developer/ef-inheritance
- Owner: Arnab-Developer
- License: mit
- Created: 2024-05-14T06:50:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-12T03:10:41.000Z (about 2 years ago)
- Last Synced: 2025-03-06T16:54:21.080Z (over 1 year ago)
- Language: C#
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# EF Inheritance
Model inheritence (default, TPT, TPC) with Entity Framework demo.
This is a demo app to show how model inheritence works with Entity Framework. There are
three ways of how EF manages inheritence. First is `table per hierarchy` which is the default,
the second is `table per type` and the third is `table per concrete type`.
I have used a simple model structure for this demo `Animal`, `Cat` and `Dog`.

There are three EF contexts and migration folders for the three ways. You can check the migrations to
understand how tables are structured for the three ways.
You can find more details in the [EF documentation](https://learn.microsoft.com/en-us/ef/core/modeling/inheritance).