Skip to content

Commit 92cadf7

Browse files
committed
# Conflicts: # src/SimpleInjector.Integration.ServiceCollection/SimpleInjectorServiceCollectionExtensions.cs
2 parents 1e25f27 + 9f6a71a commit 92cadf7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/SimpleInjector.Integration.ServiceCollection/SimpleInjectorServiceCollectionExtensions.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ public static IServiceCollection AddSimpleInjector(
7373
// Set lifestyle before calling setupAction. Code in the delegate might depend on that.
7474
TrySetDefaultScopedLifestyle(container);
7575

76-
setupAction?.Invoke(options);
77-
76+
// #17: We must register the service scope before calling the setupAction. This allows setup code to
77+
// replace it.
7878
RegisterServiceScope(options);
7979

80-
// Unfortunately, the addition of the IHostedService breaks Azure Functions. Azure Functions do no support
81-
// IHostedService. See: https://stackoverflow.com/questions/59947132/. This is why we had to make this
82-
// conditional.
80+
setupAction?.Invoke(options);
81+
82+
// #15: Unfortunately, the addition of the IHostedService breaks Azure Functions. Azure Functions do no
83+
// support IHostedService. See: https://stackoverflow.com/questions/59947132/. This is why we had to make
84+
// this conditional.
8385
if (options.EnableHostedServiceResolution)
8486
{
8587
HookAspNetCoreHostHostedServiceServiceProviderInitialization(options);

0 commit comments

Comments
 (0)