@@ -12,35 +12,31 @@ namespace Dotnet5.GraphQL3.Services.Abstractions.Extensions.DependencyInjection
1212 public static class ServiceCollectionExtensions
1313 {
1414 public static IServiceCollection AddApplicationServices ( this IServiceCollection services )
15- => services . Scan ( selector
16- => selector
17- . FromApplicationDependencies ( assembly
18- => assembly . FullName ? . StartsWith ( GetAssemblySuffix ( ) ) ?? default )
19- . AddClasses ( filter
20- => filter . AssignableToAny ( typeof ( IService < , , > ) ) )
21- . UsingRegistrationStrategy ( RegistrationStrategy . Skip )
22- . AsImplementedInterfaces ( )
23- . WithScopedLifetime ( ) ) ;
15+ => services . Scan ( selector
16+ => selector . FromApplicationDependencies ( assembly
17+ => assembly . FullName ? . StartsWith ( GetAssemblySuffix ( ) ) ?? default )
18+ . AddClasses ( filter
19+ => filter . AssignableTo ( typeof ( IService < , , > ) ) )
20+ . UsingRegistrationStrategy ( RegistrationStrategy . Skip )
21+ . AsImplementedInterfaces ( )
22+ . WithScopedLifetime ( ) ) ;
2423
2524 public static IServiceCollection AddMessageServices ( this IServiceCollection services )
26- => services . Scan ( selector
27- => selector
28- . FromApplicationDependencies ( assembly
29- => assembly . FullName ? . StartsWith ( GetAssemblySuffix ( ) ) ?? default )
30- . AddClasses ( filter
31- => filter . AssignableToAny ( typeof ( IMessageService < , , > ) ) )
32- . UsingRegistrationStrategy ( RegistrationStrategy . Skip )
33- . AsImplementedInterfaces ( )
34- . WithSingletonLifetime ( ) ) ;
25+ => services . Scan ( selector
26+ => selector . FromApplicationDependencies ( assembly
27+ => assembly . FullName ? . StartsWith ( GetAssemblySuffix ( ) ) ?? default )
28+ . AddClasses ( filter
29+ => filter . AssignableTo ( typeof ( IMessageService < , , > ) ) )
30+ . UsingRegistrationStrategy ( RegistrationStrategy . Skip )
31+ . AsImplementedInterfaces ( )
32+ . WithSingletonLifetime ( ) ) ;
3533
3634 public static IServiceCollection AddSubjects ( this IServiceCollection services )
3735 => services . AddSingleton ( typeof ( ISubject < > ) , typeof ( ReplaySubject < > ) ) ;
3836
3937 public static IServiceCollection AddAutoMapper ( this IServiceCollection services )
40- => services . AddAutoMapper (
41- AppDomain . CurrentDomain . GetAssemblies ( )
42- . Where ( x => x . FullName ?
43- . Contains ( GetAssemblySuffix ( ) ) ?? false ) ) ;
38+ => services . AddAutoMapper ( AppDomain . CurrentDomain . GetAssemblies ( ) . Where ( x
39+ => x . FullName ? . Contains ( GetAssemblySuffix ( ) ) ?? default ) ) ;
4440
4541 private static string GetAssemblySuffix ( )
4642 => Assembly . GetEntryAssembly ( ) ? . FullName ? . Substring ( 0 , 16 ) ;
0 commit comments