What I have
I have an ASP.NET Core 5.0 Blazor Server app used for internal management, in includes Services which are also used in my actual product app.
I have a dev and staging db with identical schemas.
I have services where I inject my DbContext (which load my staging or dev connection string depending on the environment), in the typical fashion.
What I need:
I want my management page to show content from both my dev and staging db.
I think something like this is what I need:
Create a DbContext for Staging and Dev, eg StagingDbContext and DevDbContext
For each service e.g. ICarService, keep my implementation CarService but now create 2 implementations like DevCarService and StagingCarService which inherit? CarService so that it can:
Pass the relevant DbContext
Be injected where I need (my management.razor page can inject DevCarService and StagingCarService).
I hope that was clear.
Thank you