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 AddDbContextFactory to allow registering a factory for creating contexts #21246

Merged
merged 1 commit into from
Jun 13, 2020

Commits on Jun 12, 2020

  1. Add AddDbContextFactory to allow registering a factory for creating c…

    …ontexts
    
    Fixes #18575
    
    Mostly this is copied from @JeremyLikness's sample, with tests added. It evolved a bit as I was testing. Most significantly, we now register an IDbContextFactory interface, for which we provide a default implementation. This allows the factory to be replaced by one specific for the application, which can be more performant because it doesn't use ActivatorUtilities. Overloads have been added for this.
    
    I believe we can also add overloads to allow the factory to resolve from a context pool, but I will file a new issue for this.
    ajcvickers committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    33d8d30 View commit details
    Browse the repository at this point in the history