@@ -7,15 +7,15 @@ namespace DryIoc.Microsoft.DependencyInjection.Extension
7
7
{
8
8
public static class ServiceCollectionExtensions
9
9
{
10
- public static IContainer RegisterServices ( this IContainer container , Action < IServiceCollection > Action , Func < IRegistrator , ServiceDescriptor , bool > registerDescriptor = null )
10
+ public static IContainer RegisterServices ( this IContainer container , Action < IServiceCollection > Action , Func < IRegistrator , ServiceDescriptor , bool > ? registerDescriptor = null )
11
11
{
12
12
var descriptors = new ServiceCollection ( ) ;
13
13
Action . Invoke ( descriptors ) ;
14
14
DependencyInjectionAdapter ( container , descriptors , registerDescriptor ) ;
15
15
return container ;
16
16
}
17
- static void DependencyInjectionAdapter ( IContainer container , IEnumerable < ServiceDescriptor > descriptors = null ,
18
- Func < IRegistrator , ServiceDescriptor , bool > registerDescriptor = null )
17
+ static void DependencyInjectionAdapter ( IContainer container , IEnumerable < ServiceDescriptor > ? descriptors = null ,
18
+ Func < IRegistrator , ServiceDescriptor , bool > ? registerDescriptor = null )
19
19
{
20
20
container . Use < IServiceScopeFactory > ( r => new DryIocServiceScopeFactory ( r ) ) ;
21
21
// Registers service collection
@@ -24,7 +24,7 @@ static void DependencyInjectionAdapter(IContainer container, IEnumerable<Service
24
24
var Provider = container . BuildServiceProvider ( ) ;
25
25
container . RegisterInstance ( Provider ) ;
26
26
}
27
- static void Populate ( IContainer container , IEnumerable < ServiceDescriptor > descriptors , Func < IRegistrator , ServiceDescriptor , bool > registerDescriptor = null )
27
+ static void Populate ( IContainer container , IEnumerable < ServiceDescriptor > descriptors , Func < IRegistrator , ServiceDescriptor , bool > ? registerDescriptor = null )
28
28
{
29
29
var d = descriptors . GroupBy ( v => v . ServiceType ) . Select ( v => ( ServiceType : v . Key , Descriptors : v . ToList ( ) ) ) ;
30
30
if ( registerDescriptor is null )
0 commit comments