using Kurisu.AspNetCore.Startup; using Kurisu.SqlSugar.Extensions; using SqlSugar; namespace Dlhis.Sys; public class SqlSugarPack : BaseAppPack { public override bool IsBeforeUseRouting { get; } public override void ConfigureServices(IServiceCollection services) { services.AddSqlSugar(sp => { var configuration = sp.GetService(); return new List { new() { ConfigId = "identity", ConnectionString = configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value, DbType = DbType.MySql, InitKeyType = InitKeyType.Attribute, IsAutoCloseConnection = true, MoreSettings = new ConnMoreSettings { DisableNvarchar = true, } }, new() { ConfigId = "default", ConnectionString = configuration.GetSection("SqlSugarOptions:DefaultConnectionString").Value, DbType = DbType.MySql, InitKeyType = InitKeyType.Attribute, IsAutoCloseConnection = true, MoreSettings = new ConnMoreSettings { DisableNvarchar = true, } } }; }); } }