netcorekit icon indicating copy to clipboard operation
netcorekit copied to clipboard

Add multiple dbcontext

Open musmanbit opened this issue 3 years ago • 0 comments

Is it possible to add multiple EFcore DB context so that I can use two different SQL databases? I tried it by making some adjustments in the code but it is not working. Can anyone share the code snippet about how to handle multiple database contexts? I tried it but the second dbcontext overriding the first dbcontext.

FYI: I have two databases and both are on the SQL Server but on different servers.

"db1": "Server=server1;Database=db1;User Id=userid;Password=password;MultipleActiveResultSets=True;", "db2": "Server=server2;Database=db2;User Id=userid;Password=password;MultipleActiveResultSets=True;"

musmanbit avatar Dec 26 '20 18:12 musmanbit