diff --git a/README-zh.md b/README-zh.md index 08555a6c..f5a37508 100644 --- a/README-zh.md +++ b/README-zh.md @@ -172,17 +172,20 @@ dbcontext `AbstractShardingDbContext`和`IShardingTableDbContext`如果你是普 op.AddShardingTableRoute(); }).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) diff --git a/README.md b/README.md index f1e1fc8f..7b2edfc9 100644 --- a/README.md +++ b/README.md @@ -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 { //private readonly IServiceProvider _serviceProvider;