It would be a good idea to have examples showing the configuration of properties of derived types (like the RssUrl property having a max length or something.)
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
There are some issues with consistency in this documentation. The initial Screenshot from SSMS shows a column of Discriminator with values of "Blog" and "RssBlog". The next chunk of code seems to name the column blog_type with values of "blog_base" and "blog_rss".
@mdressel, that's the point. The screenshot shows the default Discriminator column name ("Discriminator") and the default values that would be included for each of the two types (the names of the types).
The next chunk of code is literally prefaced with a statement that you can change the default column and name values as you please, followed by the code example showing how to do so.
@vanpyrzericj I understand, I just think it could be improved.
The documentation says "Below is an example showing a simple inheritance scenario and the data stored in a relational database table using the TPH pattern. The Discriminator column identifies which type of Blog is stored in each row." However, the example is not complete. It does not include the proper configuration to make the example work.
Instead it moves right into the next section which is, as you identified, intended to show changing the default column name values.
If the initial example was completed with the configuration that works with the example, it makes more sense.
Just my opinion.
@mdressel gotcha. Out of curiosity, what other code would you want to see included? The snippet is enough to get the basic TPH pattern working. (Assuming, yes, that you've already done the basic setup of EF in the project).
I followed the example and EF generated a duplicate ID column unexpectedly.
Most helpful comment
There are some issues with consistency in this documentation. The initial Screenshot from SSMS shows a column of Discriminator with values of "Blog" and "RssBlog". The next chunk of code seems to name the column blog_type with values of "blog_base" and "blog_rss".