File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/DotNetToolkit.Repository.Extensions.Unity Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 11namespace DotNetToolkit . Repository . Extensions . Unity
22{
3+ using Configuration . Caching ;
34 using Configuration . Interceptors ;
45 using Configuration . Logging ;
56 using DotNetToolkit . Repository . Internal ;
@@ -97,13 +98,13 @@ public static void RegisterRepositories([NotNull] this IUnityContainer container
9798
9899 foreach ( var interceptorType in scanResults . OfType < IRepositoryInterceptor > ( ) )
99100 {
100- if ( ! optionsBuilder . Options . Interceptors . ContainsKey ( interceptorType ) )
101+ if ( ! options . Interceptors . ContainsKey ( interceptorType ) )
101102 {
102103 options = options . With ( interceptorType , ( ) => ( IRepositoryInterceptor ) c . Resolve ( interceptorType ) ) ;
103104 }
104105 }
105106
106- if ( optionsBuilder . Options . LoggerProvider == null )
107+ if ( options . LoggerProvider == null )
107108 {
108109 var loggerProviderType = scanResults . OfType < ILoggerProvider > ( ) . FirstOrDefault ( ) ;
109110
@@ -113,6 +114,16 @@ public static void RegisterRepositories([NotNull] this IUnityContainer container
113114 }
114115 }
115116
117+ if ( options . CachingProvider == null )
118+ {
119+ var cacheProviderType = scanResults . OfType < ICacheProvider > ( ) . FirstOrDefault ( ) ;
120+
121+ if ( cacheProviderType != null )
122+ {
123+ options = options . With ( ( ICacheProvider ) c . Resolve ( cacheProviderType ) ) ;
124+ }
125+ }
126+
116127 return options ;
117128 } , factorylifetimeManager ) ;
118129
You can’t perform that action at this time.
0 commit comments