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

AddPooledDbContextFactory #1

Open
FoxTes opened this issue May 4, 2022 · 1 comment
Open

AddPooledDbContextFactory #1

FoxTes opened this issue May 4, 2022 · 1 comment

Comments

@FoxTes
Copy link

FoxTes commented May 4, 2022

Good afternoon.

I looked at your course and I had a question.
You are considering the context connection option as AddContext(). In this case, everything is fine in your example. But what if I want to use AddPooledDbContextFactory(). How do I implement a factory and encapsulate the logic?

@vkhorikov
Copy link
Owner

Haven't tried this with AddDbContextPool, but the approach from the course may not work with this extension method directly, indeed. In this case, you could add a method in your DbContext that would do the configuration. It's not as clean as what I showed in the course, but at least the logic of configuring the DbContext would reside in that DbContext itself.

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

2 participants