diff --git a/WebStarter/Program.cs b/WebStarter/Program.cs index 1a4dfe7..ddf6368 100644 --- a/WebStarter/Program.cs +++ b/WebStarter/Program.cs @@ -21,10 +21,17 @@ builder.Host.ConfigureContainer(cb => var db = new SqlSugarScope(new ConnectionConfig { ConfigId = AppSettingsConstVars.ConfigId, - ConnectionString = AppSettingsConstVars.DbSqlConnection, // �������ݿ������ַ��� + ConnectionString = AppSettingsConstVars.DbSqlConnection, DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? DbType.MySql : DbType.SqlServer, IsAutoCloseConnection = true, - InitKeyType = InitKeyType.Attribute // ���ʹ��ʵ��������Խ���������ʶ��������Ϊ InitKeyType.Attribute + InitKeyType = InitKeyType.Attribute + }, c => + { + c.Aop.OnLogExecuting = (sql, pars) => + { + string nativeSql = UtilMethods.GetNativeSql(sql, pars); + log.Info(nativeSql); + }; }); return db; }).As().InstancePerLifetimeScope();