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

Flow scoped DI services through pipeline #10

Closed
brettsam opened this issue Aug 3, 2020 · 1 comment · Fixed by #11
Closed

Flow scoped DI services through pipeline #10

brettsam opened this issue Aug 3, 2020 · 1 comment · Fixed by #11

Comments

@brettsam
Copy link
Member

brettsam commented Aug 3, 2020

This includes creating the function class with the DI services (if not static).

@brettsam
Copy link
Member Author

brettsam commented Aug 4, 2020

Initial design points:

  1. Add an IFunctionExecutionContextFactory with one method: FunctionExecutionContext Create(InvocationRequest request)
  2. Create a DefaultFunctionExecutionFactory... as a constructor it should take an IServiceScopeFactory. This is used to create the scoped services.
  3. On FunctionExecutionContext, add a property IServiceProvider InvocationServices {get;}. This will hold the scoped services for that function invocation.
  4. In order to create the scoped services, we'll need to pass an IServiceScopeFactory into the DefaultFunctionExecutionFactory via DI -- and then pass that into the FunctionExecutionContext when it gets created. IServiceScopeFactory is the thing that lets us call CreateScope() -- which gives us the IServiceProvider we want to use with InvocationServices
  5. So when we create a new context, you can create the scope and then assign that to InvocationServices.

Then we'll iterate from there :-)

@satvu satvu linked a pull request Aug 4, 2020 that will close this issue
@satvu satvu closed this as completed in #11 Aug 5, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants