mirror of
https://github.com/AlexMacocian/Slim.git
synced 2026-07-19 00:59:47 +00:00
e8adfa1acc
* Setup integration with Microsoft.Extensions.DependencyInjection * Setup Slim integration project with Microsoft.Extensions.DependencyInjection
21 lines
561 B
C#
21 lines
561 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Slim.Integration.ServiceCollection;
|
|
|
|
public sealed class ServiceScopeFactory : IServiceScopeFactory
|
|
{
|
|
private readonly IServiceManager serviceManager;
|
|
|
|
public ServiceScopeFactory(
|
|
IServiceManager serviceManager)
|
|
{
|
|
this.serviceManager = serviceManager;
|
|
}
|
|
|
|
public IServiceScope CreateScope()
|
|
{
|
|
IServiceProvider scopedServiceManager = this.serviceManager.CreateScope();
|
|
return new ServiceScope { ServiceProvider = scopedServiceManager };
|
|
}
|
|
}
|