I am creating a web application works off of a multitenancy structure. As such, each user request will lock that user a specific tenant based on the hostname (with different databases per tenant.) I can set a general context's connection string, but I am at a loss right now on figuring out how to change the connection string for the ASP.NET Core 2.0 Identity objects.
I see that the default way that they have us doing it is setting the UseAuthentication() in StartUp.cs. And then when the controller is called, DI then sets the UserManager and SignInManager objects. I am assuming I need to create new UserManager and SignInManager objects within each controller constructor passing the specific connection string for that tenant (not using DI at all.)
Any thoughts on this?
Clarification:
My hope is to figure out if it is possible to change the database connection string for a passed identity object to a controller by dependency injection.