66 using Configuration . Options . Internal ;
77 using global ::Microsoft . Extensions . DependencyInjection ;
88 using JetBrains . Annotations ;
9- using Services ;
109 using System ;
11- using System . Collections . Generic ;
1210 using System . Linq ;
1311 using System . Reflection ;
14- using Transactions ;
1512 using Utility ;
1613
1714 /// <summary>
@@ -75,6 +72,7 @@ public static IServiceCollection AddRepositories([NotNull] this IServiceCollecti
7572
7673 var scanResults = AssemblyScanner . FindRepositoriesFromAssemblies ( assembliesToScan ) ;
7774
75+ // Register scanned types
7876 scanResults . ForEach ( scanResult =>
7977 {
8078 foreach ( var implementationType in scanResult . ImplementationTypes )
@@ -93,27 +91,7 @@ public static IServiceCollection AddRepositories([NotNull] this IServiceCollecti
9391 }
9492 } ) ;
9593
96- // Register other services
97- services . Add ( new ServiceDescriptor (
98- typeof ( IRepositoryFactory ) ,
99- sp => new RepositoryFactory ( sp . GetRequiredService < IRepositoryOptions > ( ) ) ,
100- serviceLifetime ) ) ;
101-
102- services . Add ( new ServiceDescriptor (
103- typeof ( IUnitOfWork ) ,
104- sp => new UnitOfWork ( sp . GetRequiredService < IRepositoryOptions > ( ) ) ,
105- serviceLifetime ) ) ;
106-
107- services . Add ( new ServiceDescriptor (
108- typeof ( IUnitOfWorkFactory ) ,
109- sp => new UnitOfWorkFactory ( sp . GetRequiredService < IRepositoryOptions > ( ) ) ,
110- serviceLifetime ) ) ;
111-
112- services . Add ( new ServiceDescriptor (
113- typeof ( IServiceFactory ) ,
114- sp => new ServiceFactory ( sp . GetRequiredService < IRepositoryOptions > ( ) ) ,
115- serviceLifetime ) ) ;
116-
94+ // Register options services
11795 services . Add ( new ServiceDescriptor (
11896 typeof ( IRepositoryOptions ) ,
11997 sp =>
0 commit comments