C#
C#

help

Root Question Message

stayclaxxy
stayclaxxy1/26/2023
❔ EFCore in .net 6 Web API - using same context/model for multiple environments simultaniously.

I am trying to write a Web API, one of the GET methods in a controller needs to return data from the same table, but in multiple environments. All of the envrionments' schemas are the same (except login credentials/connection string). I was wondering if there is a way to use the same context and table model class to query all 3 environments with EFCore for the sake of keeping the code dry and clean. TIA
Oops365
Oops3651/31/2023
Did you figure out an answer to this? You should be able to use the same classes and just change your connection string per environment in your Startup/Program.cs when registering the dbcontext
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy