Skip to content

Commit

Permalink
Add AddDbContextFactory to allow registering a factory for creating c…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
ajcvickers committed Jun 12, 2020
1 parent a132b90 commit 33d8d30
Show file tree
Hide file tree
Showing 4 changed files with 794 additions and 32 deletions.
Loading

0 comments on commit 33d8d30

Please sign in to comment.