File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
src/DotNetToolkit.Repository.Extensions.Unity Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -75,13 +75,15 @@ public static void RegisterRepositories([NotNull] this IUnityContainer container
7575
7676 var scanResults = AssemblyScanner . FindRepositoriesFromAssemblies ( assembliesToScan ) ;
7777
78+ // Register scanned types
7879 scanResults . ForEach ( scanResult =>
7980 {
8081 foreach ( var implementationType in scanResult . ImplementationTypes )
8182 {
83+ container . RegisterType ( implementationType ) ;
84+
8285 if ( scanResult . InterfaceType == typeof ( IRepositoryInterceptor ) )
8386 {
84- container . RegisterType ( implementationType , implementationType ) ;
8587 container . RegisterType ( scanResult . InterfaceType , implementationType , implementationType . FullName ) ;
8688 }
8789 else
@@ -91,11 +93,7 @@ public static void RegisterRepositories([NotNull] this IUnityContainer container
9193 }
9294 } ) ;
9395
94- // Register other services
95- container . RegisterFactory < IRepositoryFactory > ( c => new RepositoryFactory ( c . Resolve < IRepositoryOptions > ( ) ) , factorylifetimeManager ) ;
96- container . RegisterFactory < IUnitOfWork > ( c => new UnitOfWork ( c . Resolve < IRepositoryOptions > ( ) ) , factorylifetimeManager ) ;
97- container . RegisterFactory < IUnitOfWorkFactory > ( c => new UnitOfWorkFactory ( c . Resolve < IRepositoryOptions > ( ) ) , factorylifetimeManager ) ;
98- container . RegisterFactory < IServiceFactory > ( c => new ServiceFactory ( c . Resolve < IUnitOfWorkFactory > ( ) ) , factorylifetimeManager ) ;
96+ // Register options services
9997 container . RegisterFactory < IRepositoryOptions > ( c =>
10098 {
10199 var options = new RepositoryOptions ( optionsBuilder . Options ) ;
You can’t perform that action at this time.
0 commit comments