master
rszn 5 months ago
parent 53c49e0f39
commit 8cd11c9e63

@ -21,10 +21,17 @@ builder.Host.ConfigureContainer<ContainerBuilder>(cb =>
var db = new SqlSugarScope(new ConnectionConfig
{
ConfigId = AppSettingsConstVars.ConfigId,
ConnectionString = AppSettingsConstVars.DbSqlConnection, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
ConnectionString = AppSettingsConstVars.DbSqlConnection,
DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? DbType.MySql : DbType.SqlServer,
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute // <20><><EFBFBD>ʹ<EFBFBD><CAB9>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><D4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ InitKeyType.Attribute
InitKeyType = InitKeyType.Attribute
}, c =>
{
c.Aop.OnLogExecuting = (sql, pars) =>
{
string nativeSql = UtilMethods.GetNativeSql(sql, pars);
log.Info(nativeSql);
};
});
return db;
}).As<ISqlSugarClient>().InstancePerLifetimeScope();

Loading…
Cancel
Save