Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inherited Classes Mapping #2267

Closed
alfkonee opened this issue May 24, 2015 · 4 comments
Closed

Inherited Classes Mapping #2267

alfkonee opened this issue May 24, 2015 · 4 comments

Comments

@alfkonee
Copy link

Inherited Classes in EF models need to be related in the database with the Generalization rule in database normalization.
Eg: I have four classes Person Guardian Student and Teacher. The last three inherit from the first but when I run the CreateTables function for database I get four different Tables each with all the fields inherited from the Person table. Instead of the related tables I would have gotten in EF 6

@Boglen
Copy link

Boglen commented May 26, 2015

try
public class SomeContext : DbContext
{
public DbSet Persons {get;set;}
}

not public DbSet Guardians {get;set;} and etc

@alfkonee
Copy link
Author

I'm using IdentityDbContext will it still work if I remove the Inherited classed DbSet

@rowanmiller
Copy link
Contributor

Inheritance isn't fully implemented yet in EF7. Pieces of it are implemented but there is no end-to-end support enabled yet. The work is being tracked by #247.

@weitzhandler
Copy link
Contributor

This issue is a breaker.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants