Closed alexeymarkov closed 4 years ago
Sure it should be added to all templates.
Instead of using own IServiceCollection and build it into IServiceProvider more clever solutions would be to use IServiceCollection directly from FunctionStatrtup and inject IServiceProvider into a function class. This IServiceProvider instance is already scoped and would allow injection of ILogger
I will try to figure out how to implement it.
Good news: I almost finished the implementation but need a few hours to polish it.
I did not check for other triggers although I adjusted them too. Now IServiceCollection/IServiceProvider from WebJobsStartup are used.
Many thanks for this everyone - super appreciated.
Its now in the v4 beta on master.
…dencies properly.
For instance, now IDisposable scoped dependencies such as DbContext are released properly.