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

Allow scoped application services to be accessed from the context #9009

Merged
merged 1 commit into from Jun 29, 2017

Commits on Jun 29, 2017

  1. Allow scoped application services to be accessed from the context

    Issue #8797
    
    After going back and forth on this I settled on:
    * Register DbContextOptions as scoped by default
      * This allows scoped services to be used in AddDbContext
      * This allows scoped services to be resolved from context.GetService
      * It will still work fine if scoped services are not needed
    * Add another parameter to AddDbContext to allow the options to be registered as Singleton if needed
      * This can be used for apps that are doing some heavy lifting in AddDbContext
    ajcvickers committed Jun 29, 2017
    Copy the full SHA
    c5e16a9 View commit details
    Browse the repository at this point in the history