@@ -21,7 +21,7 @@ public UnitOfWork()
2121 var cb = new ContainerBuilder ( ) ;
2222
2323 cb . Register ( t => this ) . AsImplementedInterfaces ( ) . AsSelf ( ) . As < UnitOfWork > ( ) ;
24- cb . RegisterType < Repository > ( ) . AsSelf ( ) . As < IRepository > ( ) . PreserveExistingDefaults ( ) ;
24+ cb . RegisterType < Repository > ( ) . AsSelf ( ) . As < IRepository > ( ) ;
2525 cb . RegisterGeneric ( typeof ( Repository < > ) ) . AsSelf ( ) . As ( typeof ( IRepository < > ) ) ;
2626 cb . RegisterGeneric ( typeof ( Repository < , > ) ) . AsSelf ( ) . As ( typeof ( IRepository < , > ) ) ;
2727 cb . RegisterGeneric ( typeof ( Repository < , , > ) ) . AsSelf ( ) . As ( typeof ( IListRepository < , , > ) ) ;
@@ -180,11 +180,11 @@ private TRepository GetRepository<TRepository>(bool force = false) where TReposi
180180
181181 public TRepository CustomRepository < TRepository > ( ) where TRepository : IRepository => GetRepository < TRepository > ( true ) ;
182182
183- public IRepository < T > Repository < T > ( ) where T : class , new ( ) => GetRepository < IRepository < T > > ( ) ;
183+ public IRepository < T > Repository < T > ( ) where T : class , new ( ) => GetRepository < IRepository < T > > ( ) ?? CustomRepository < Repository < T > > ( ) ;
184184
185- public IRepository < TSource , TDestination > Repository < TSource , TDestination > ( ) where TSource : class , new ( ) where TDestination : class , new ( ) => GetRepository < IRepository < TSource , TDestination > > ( ) ;
185+ public IRepository < TSource , TDestination > Repository < TSource , TDestination > ( ) where TSource : class , new ( ) where TDestination : class , new ( ) => GetRepository < IRepository < TSource , TDestination > > ( ) ?? CustomRepository < Repository < TSource , TDestination > > ( ) ;
186186
187- public IListRepository < TSource , TDestination , TListDestination > Repository < TSource , TDestination , TListDestination > ( ) where TSource : class , new ( ) where TDestination : class , new ( ) where TListDestination : class , new ( ) => GetRepository < IListRepository < TSource , TDestination , TListDestination > > ( ) ;
187+ public IListRepository < TSource , TDestination , TListDestination > Repository < TSource , TDestination , TListDestination > ( ) where TSource : class , new ( ) where TDestination : class , new ( ) where TListDestination : class , new ( ) => GetRepository < IListRepository < TSource , TDestination , TListDestination > > ( ) ?? CustomRepository < Repository < TSource , TDestination , TListDestination > > ( ) ;
188188
189189 public virtual IQueryable < T > Data < T > ( ) where T : class , new ( ) => Enumerable . Empty < T > ( ) . AsQueryable ( ) ;
190190
0 commit comments