Open jasekiw opened 4 years ago
@jasekiw Thanks for filing this. In reality, it's almost always wrong to call this. Most commonly in cases like this the base type should not be mapped at all. So the most common correct resolution is to find out why it is being mapped (e.g. DbSet on the context, relationships to the type, etc.) and then correct that. If you post your model classes and OnModelCreating code, then we can take a closer look.
In the documentation there is a Tip section that says the following.
I am specifically interested in the following sentence:
I think it would be best for there to be more than just one sentence on this topic. There are no examples of the use cases this provides.
My specific use case
A specific use case that I am trying to implement is to have 3 entities. 1 base class, and two subclasses. The base class has some default columns that both subclasses need but I don't want the base class has no real use in the database. Right now I am working around this issue by creating a placeholder value called Null in the discriminator enum.
Does
.HasBaseType((Type)null)
fill this need? If so I think an example needs to be added to understand the use cases of this method better.Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.