Merge pull request #3953 from sbwalker/dev

change IServerService to use Transient rather than Scoped
This commit is contained in:
Shaun Walker 2024-03-05 10:50:19 -05:00 committed by GitHub
commit b948961d52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -297,7 +297,7 @@ namespace Microsoft.Extensions.DependencyInjection
}
}
// dynamically register module server scoped services (using conventions)
// dynamically register module server transient services (using conventions)
implementationTypes = assembly.GetInterfaces<IServerService>();
foreach (var implementationType in implementationTypes)
{
@ -310,7 +310,7 @@ namespace Microsoft.Extensions.DependencyInjection
var serviceType = Type.GetType(serviceName);
if (serviceType != null)
{
services.AddScoped(serviceType, implementationType);
services.AddTransient(serviceType, implementationType);
}
}
}