@@ -20,13 +20,13 @@ public ServiceTypeSelector(IImplementationTypeSelector inner, ISet<Type> types)
20
20
21
21
private ISet < Type > Types { get ; }
22
22
23
- private List < ISelector > Selectors { get ; } = new ( ) ;
23
+ private List < ISelector > Selectors { get ; } = [ ] ;
24
24
25
25
private RegistrationStrategy ? RegistrationStrategy { get ; set ; }
26
26
27
27
public ILifetimeSelector AsSelf ( )
28
28
{
29
- return As ( t => new [ ] { t } ) ;
29
+ return As ( t => [ t ] ) ;
30
30
}
31
31
32
32
public ILifetimeSelector As < T > ( )
@@ -45,7 +45,7 @@ public ILifetimeSelector As(IEnumerable<Type> types)
45
45
{
46
46
Preconditions . NotNull ( types , nameof ( types ) ) ;
47
47
48
- return AddSelector ( Types . Select ( t => new TypeMap ( t , types ) ) , Enumerable . Empty < TypeFactoryMap > ( ) ) ;
48
+ return AddSelector ( Types . Select ( t => new TypeMap ( t , types ) ) , [ ] ) ;
49
49
}
50
50
51
51
public ILifetimeSelector AsImplementedInterfaces ( )
@@ -70,7 +70,7 @@ public ILifetimeSelector AsSelfWithInterfaces(Func<Type, bool> predicate)
70
70
Preconditions . NotNull ( predicate , nameof ( predicate ) ) ;
71
71
72
72
return AddSelector (
73
- Types . Select ( t => new TypeMap ( t , new [ ] { t } ) ) ,
73
+ Types . Select ( t => new TypeMap ( t , [ t ] ) ) ,
74
74
Types . Select ( t => new TypeFactoryMap ( t , x => x . GetRequiredService ( t ) , Selector ( t , predicate ) ) ) ) ;
75
75
76
76
static IEnumerable < Type > Selector ( Type type , Func < Type , bool > predicate )
@@ -79,7 +79,7 @@ static IEnumerable<Type> Selector(Type type, Func<Type, bool> predicate)
79
79
{
80
80
// This prevents trying to register open generic types
81
81
// with an ImplementationFactory, which is unsupported.
82
- return Enumerable . Empty < Type > ( ) ;
82
+ return [ ] ;
83
83
}
84
84
85
85
return GetInterfaces ( type ) . Where ( predicate ) ;
@@ -100,7 +100,7 @@ public ILifetimeSelector As(Func<Type, IEnumerable<Type>> selector)
100
100
{
101
101
Preconditions . NotNull ( selector , nameof ( selector ) ) ;
102
102
103
- return AddSelector ( Types . Select ( t => new TypeMap ( t , selector ( t ) ) ) , Enumerable . Empty < TypeFactoryMap > ( ) ) ;
103
+ return AddSelector ( Types . Select ( t => new TypeMap ( t , selector ( t ) ) ) , [ ] ) ;
104
104
}
105
105
106
106
public IImplementationTypeSelector UsingAttributes ( )
0 commit comments