You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an IFunctionExecutionContextFactory with one method: FunctionExecutionContext Create(InvocationRequest request)
Create a DefaultFunctionExecutionFactory... as a constructor it should take an IServiceScopeFactory. This is used to create the scoped services.
On FunctionExecutionContext, add a property IServiceProvider InvocationServices {get;}. This will hold the scoped services for that function invocation.
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
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
linked a pull request
Aug 4, 2020
that will
close
this issue
This includes creating the function class with the DI services (if not static).
The text was updated successfully, but these errors were encountered: