question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Multiple DbContext Support

See original GitHub issue

Recently, I ran into a requirement of referencing multiple databases in a single project. Latest version of EFCorePowerTools can generate multiple DatabaseContexts, but overrides the configuration in efpt.config.json with the last used DatabaseContext.

Is there any plan on supporting configuration for multiple datacontexts in the efpt.config.json?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:20 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
ErikEJcommented, Sep 28, 2020
1reaction
LouisGordoncommented, Nov 10, 2018

Thanks for the response, sorry for my late reply. We have backed away from ef core at the moment but I could have considered the approach of keeping the contexts in different libraries, though I had a single project that would need to reference both. We’re on a multi tenant platform where a number of years ago decisions were made to segregate certain pieces of data, likely with pretty good reasons.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Entity Framework: One Database, Multiple DbContexts. Is ...
You can have multiple contexts for single database. It can be useful for example if your database contains multiple database schemas and you ......
Read more >
Why is it suggested to have on DbContext instance per ...
It will be bad to create one global Entity Framework DbContext in a web application, because the DbContext class is not thread-safe. In...
Read more >
How do i handle multiple DbContexts with relations to each ...
I'm currently working on my semester project that is based on ASP.NET Core MVC. We've been introduced to EntityFrameworkCore and generally i ...
Read more >
How to Get multiple database DBContext service in .net ...
Hello Coders, I want to know how to connect with multiple databases in web application in .net core MVC 3.1 dynamically as per...
Read more >
Best Practices in Using the DbContext in EF Core
If you need multiple database connections or have multiple active contexts operating in parallel, then use the DbContextFactory class ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found