File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 32
32
<PackageReference Include =" AutoMapper" Version =" 9.0.0" />
33
33
<PackageReference Include =" Caching.CSRedis" Version =" 3.6.2" />
34
34
<PackageReference Include =" CSRedisCore" Version =" 3.6.2" />
35
- <PackageReference Include =" EFCore.Sharding" Version =" 3.1.3.36 " />
35
+ <PackageReference Include =" EFCore.Sharding" Version =" 3.1.3.39 " />
36
36
<PackageReference Include =" EFCore.Sharding.SqlServer" Version =" 3.1.3" />
37
37
<PackageReference Include =" IdHelper.Zookeeper" Version =" 1.5.1" />
38
38
<PackageReference Include =" Microsoft.AspNetCore" Version =" 2.2.0" />
Original file line number Diff line number Diff line change @@ -45,10 +45,15 @@ public TransactionContainer(IServiceProvider serviceProvider)
45
45
{
46
46
_distributedTransaction = DistributedTransactionFactory . GetDistributedTransaction ( ) ;
47
47
48
- var repositories = GlobalData . AllFxTypes . Where ( x =>
49
- typeof ( IRepository ) . IsAssignableFrom ( x )
50
- && x . IsInterface
51
- ) . Select ( x => serviceProvider . GetService ( x ) as IRepository )
48
+ var allRepositoryInterfaces = GlobalData . AllFxTypes . Where ( x =>
49
+ typeof ( IRepository ) . IsAssignableFrom ( x )
50
+ && x . IsInterface
51
+ && x != typeof ( IRepository )
52
+ ) . ToList ( ) ;
53
+ allRepositoryInterfaces . Add ( typeof ( IRepository ) ) ;
54
+
55
+ var repositories = allRepositoryInterfaces
56
+ . Select ( x => serviceProvider . GetService ( x ) as IRepository )
52
57
. ToArray ( ) ;
53
58
54
59
_distributedTransaction . AddRepository ( repositories ) ;
Original file line number Diff line number Diff line change 1
- using EFCore . Sharding ;
2
- using System ;
1
+ using System ;
3
2
using System . Collections . Generic ;
4
3
using System . IO ;
5
4
using System . Linq ;
@@ -45,8 +44,6 @@ public static List<Type> AllFxTypes
45
44
46
45
}
47
46
} ) ;
48
-
49
- _allFxTypes . Add ( typeof ( IRepository ) ) ;
50
47
}
51
48
}
52
49
}
You can’t perform that action at this time.
0 commit comments