Skip to content

Commit 4b69cd6

Browse files
committed
完成readme的对事务的使用和启动配置
1 parent 2783b7c commit 4b69cd6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ or
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
{
@@ -390,8 +389,6 @@ or
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
```
569566
2.手动开启事务 [请参考微软](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();

0 commit comments

Comments
 (0)