My question is about creating tables through dbcontext options.
In short, I'm developing a reusable base dbContext
for future uses and I have some tables, that sometimes I would like to use, other times I would not.
For example I have a translations table set for storing different translations in different languages, if I would like to use it, I just could do something like this:
using var context = new CustomDbContext(optionsBuilder
.AddTranslations()
.Options);
How can I achieve this?
Another idea: I saw from this post that one should use different dbContext
objects for different kinds of tables. For example I should have a translations context, identity context (for login and such) and so on.
Should one use this approach instead of the optionsbuilder one?