-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Avoid separate table for each base entity #2907
Comments
Inheritance support is still being worked on and depending on which build you are using you might get different levels of functionality. In fact we have only recently added convention and configuration support for discriminator columns in Code First. @AndriySvyryd can comment on what the minimal level of configuration you will have to do to get inheritance working is currently. Regardless, if as you said in the comment on #247 you don't want the base class (in this case |
@divega |
@divega @rowanmiller @AndriySvyryd How can I get rid of EF generating two SQL tables for This is a blocking issue. |
@weitzhandler
However inheritance support is not fully implemented yet, so you might run into errors at runtime. |
@AndriySvyryd However I have a different issue. I have a one-to-many reference between As you can see, the the FK is generated twice, thus throwing the following error when trying to generate database:
I've posted a question about this on SO. Well looks like this is under control: |
Hi,
I'm trying to subclass
IdentityDbContext
to support multi-tenancy. I want to implement something similar to JSkimming's solution.Anyway, generally if I have one
Person
and oneTeacher
and I have aDbSet<Person>
in my context, two tables containing ALL the properties of bothPerson
andTeacher
are being generated in the database.Is there a way to avoid that?
I have an entity
Tenant
, here is the code:But when I try to add a migration, I get the following error:
If I add a
Key
attribute onTenant<TKey>.Id
the following is generated to the migration:The text was updated successfully, but these errors were encountered: