Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple dbcontext #48

Open
musmanbit opened this issue Dec 26, 2020 · 0 comments
Open

Add multiple dbcontext #48

musmanbit opened this issue Dec 26, 2020 · 0 comments

Comments

@musmanbit
Copy link

musmanbit commented Dec 26, 2020

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;"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant