public void ConfigureServices(IServiceCollection services) {
//添加分片配置 services.AddShardingDbContext()
.UseRouteConfig(op => { op.AddShardingTableRoute(); }).UseConfig((sp,op) => {
op.UseShardingQuery((conn, builder) => { builder.UseSqlServer(conn); });
op.UseShardingTransaction((conn, builder) => { builder.UseSqlServer(conn); }); op.AddDefaultDataSource(Guid.NewGuid().ToString("n"), "Data Source=localhost;Initial Catalog=EFCor eShardingTableDB;Integrated Security=True;"); }).AddShardingCore(); }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment(www.laipuhuo.com)) {
app.UseDeveloperExceptionPage(); } //not required, enable check table missing and
auto create,非必须 启动检查缺少的表并且创建
app.ApplicationServices.UseAutoTryCompensateTable(); // other configure.... } { "pages": [ "pages/index/index", "pages/logs/logs" ], "window": { "navigationBarTitleText": "小程序示例", "navigationBarBackgroundColor": "#ffffff", "navigationBarTextStyle": "black", "backgroundColor":www.laipuhuo.com "#eeeeee", "backgroundTextStyle": "light", "enablePullDownRefresh": true, "onReachBottomDistance": 50 }, "tabBar": { "color": "#7A7E83", "selectedColor
": "#3cc51f",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/icon_home.png",
"selectedIconPath": "images/icon_home_active.png"
},
{
"pagePath": "pages/logs/logs",
"text": "日志",
"iconPath":www.laipuhuo.com "images/icon_logs.png",
"selectedIconPath": "images/icon_logs_active.png"
}
]
}, "style": "v2" }