I'm looking for the best way to set the database based on a sub-domain using entity framework.
- Connect to Master DB using default EF process
- Read sub-domain of current request
- Access Master DB to read the connection string of the sub-domain
- Set EF context to use the DB of the sub-domain
- All EF connections should now use the sub-domain DB
I'm not interested in migrations on the Master DB, but I do want it working on the sub-domains.
This is the best I've found so far, but I wonder if there is a more streamlined way of doing it: https://www.reddit.com/r/dotnet/comments/2t2xlz/entity_framework_multiple_database_single/