feat 创建系统默认分组

This commit is contained in:
2024-02-22 14:30:03 +08:00
parent 9345cc6441
commit 170b6a1202
8 changed files with 212 additions and 20 deletions

View File

@@ -17,14 +17,14 @@ public class SqlSugarPack : BaseAppPack
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
//using var scope = app.ApplicationServices.CreateScope();
//var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
//var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false))
// .Where(x => !x.IsDefined(typeof(SkipScanAttribute), false))
// .ToArray();
using var scope = app.ApplicationServices.CreateScope();
var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false))
.Where(x => !x.IsDefined(typeof(SkipScanAttribute), false))
.ToArray();
//db.DbMaintenance.CreateDatabase();
//db.CodeFirst.InitTables(tables);
db.DbMaintenance.CreateDatabase();
db.CodeFirst.InitTables(tables);
//using var scopeFace = app.ApplicationServices.CreateScope();
//var dbFace = scopeFace.ServiceProvider.GetService<ISqlSugarClient>();