zw
rszn 5 months ago
parent 831b81a074
commit 66f17cf266

@ -1,7 +1,6 @@
using System.Text; using System.Text;
using Autofac; using Autofac;
using Autofac.Extensions.DependencyInjection; using Autofac.Extensions.DependencyInjection;
using Common.Util;
using Entity.Dto.Resp; using Entity.Dto.Resp;
using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.AutoTask; using HybirdFrameworkCore.AutoTask;
@ -34,6 +33,13 @@ builder.Host.ConfigureContainer<ContainerBuilder>(cb =>
IsAutoCloseConnection = true, IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute // 如果使用实体类的属性进行主键标识,请设置为 InitKeyType.Attr InitKeyType = InitKeyType.Attribute // 如果使用实体类的属性进行主键标识,请设置为 InitKeyType.Attr
}, c =>
{
c.Aop.OnLogExecuting = (sql, pars) =>
{
string nativeSql = UtilMethods.GetNativeSql(sql, pars);
log.Info(nativeSql);
};
}); });
return db; return db;
}).As<ISqlSugarClient>().SingleInstance(); }).As<ISqlSugarClient>().SingleInstance();
@ -161,4 +167,4 @@ if (AppSettingsHelper.GetBool("swap", "enable"))
TaskInit.Init(); TaskInit.Init();
app.Run(); app.Run();

Loading…
Cancel
Save