File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change 201201 o .CreateShardingTableOnStart = true ;// create sharding table
202202 o .EnsureCreatedWithOutShardingTable = true ;// create data source with out sharding table
203203 })
204- .AddShardingTransaction ((connection , builder ) => builder .UseSqlServer (connection ))
205204 .AddDefaultDataSource (" ds0" , " Data Source=localhost;Initial Catalog=ShardingCoreDB1;Integrated Security=True;" )
206205 .AddShardingTableRoute (o =>
207206 {
390389 o .CreateShardingTableOnStart = true ;
391390 o .EnsureCreatedWithOutShardingTable = true ;
392391 })
393- .AddShardingTransaction ((connection , builder ) =>
394- builder .UseSqlServer (connection ))
395392 .AddDefaultDataSource (" ds0" ," Data Source=localhost;Initial Catalog=ShardingCoreDBxx0;Integrated Security=True;" )
396393 .AddShardingDataSource (sp =>
397394 {
@@ -568,7 +565,7 @@ ctor inject IShardingRouteManager shardingRouteManager
568565```
5695662 .手动开启事务 [请参考微软](https :// docs.microsoft.com/zh-cn/ef/core/saving/transactions)
570567 ```c #
571- using (var tran = _defaultTableDbContext .BeginTransaction ())
568+ using (var tran = _defaultTableDbContext .DataBase . BeginTransaction ())
572569 {
573570 ........
574571 _defaultTableDbContext .SaveChanges ();
You can’t perform that action at this time.
0 commit comments