修改readme文件
This commit is contained in:
parent
7f1edb4dd8
commit
716508cbdf
13
README-zh.md
13
README-zh.md
|
@ -172,17 +172,20 @@ dbcontext `AbstractShardingDbContext`和`IShardingTableDbContext`如果你是普
|
|||
op.AddShardingTableRoute<OrderVirtualTableRoute>();
|
||||
}).UseConfig(op =>
|
||||
{
|
||||
op.UseShardingQuery((conn, builder) =>
|
||||
op.UseShardingQuery((connStr, builder) =>
|
||||
{
|
||||
builder.UseSqlServer(conn);
|
||||
//connStr is delegate input param
|
||||
builder.UseSqlServer(connStr);
|
||||
});
|
||||
op.UseShardingTransaction((conn, builder) =>
|
||||
op.UseShardingTransaction((connection, builder) =>
|
||||
{
|
||||
builder.UseSqlServer(conn);
|
||||
//connection is delegate input param
|
||||
builder.UseSqlServer(connection);
|
||||
});
|
||||
//use your data base connection string
|
||||
op.AddDefaultDataSource(Guid.NewGuid().ToString("n"),
|
||||
"Data Source=localhost;Initial Catalog=EFCoreShardingTableDB;Integrated Security=True;");
|
||||
}).EnsureConfig();
|
||||
}).AddShardingCore();
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
|
|
|
@ -129,7 +129,8 @@ sharding table(spilt table eg. order_202101,order_202102,order_202103......),u n
|
|||
### Step 4:Create route that data(Order) query mapping table name
|
||||
|
||||
```csharp
|
||||
Route constructor support dependency injection,that's life time scope is `Singleton`
|
||||
//Route constructor support dependency injection,that's life time scope is `Singleton`
|
||||
|
||||
public class OrderVirtualTableRoute:AbstractSimpleShardingMonthKeyDateTimeVirtualTableRoute<Order>
|
||||
{
|
||||
//private readonly IServiceProvider _serviceProvider;
|
||||
|
|
Loading…
Reference in New Issue