增加视图模型引擎模块
This commit is contained in:
@@ -30,37 +30,43 @@ public static class ConfigureSqlSugarExtensions
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
IsAutoRemoveDataCache = true // 自动清理缓存
|
||||
IsAutoRemoveDataCache = true, // 自动清理缓存
|
||||
IsAutoToUpper = false,
|
||||
//PgSqlIsAutoToLower = false,
|
||||
DisableNvarchar = true
|
||||
},
|
||||
});
|
||||
|
||||
services.AddSqlSugar(connectConfigList, client =>
|
||||
{
|
||||
connectConfigList.ForEach(config =>
|
||||
{
|
||||
var db = ((SqlSugarScope)client).GetConnectionScope((string)config.ConfigId);
|
||||
//connectConfigList.ForEach(config =>
|
||||
//{
|
||||
// var db = ((SqlSugarScope)client).GetConnectionScope((string)config.ConfigId);
|
||||
|
||||
// 设置超时时间
|
||||
db.Ado.CommandTimeOut = 30;
|
||||
//db.Aop.OnLogExecuted = (sql, pars) =>
|
||||
//{
|
||||
// var oldColor = Console.ForegroundColor;
|
||||
// Console.ForegroundColor = ConsoleColor.Green;
|
||||
// var finalSql = UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, sql, pars);
|
||||
// Console.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss.fff")}——SQL执行完成】{db.Ado.SqlExecutionTime.TotalMilliseconds} ms");
|
||||
// Console.WriteLine(finalSql);
|
||||
// Console.ForegroundColor = oldColor;
|
||||
// if (db.Ado.SqlExecutionTime.TotalMilliseconds > 3000)
|
||||
// {
|
||||
// Log.Warning($"慢查询: {db.Ado.SqlExecutionTime.TotalMilliseconds}ms, SQL: " + finalSql);
|
||||
// }
|
||||
// Console.WriteLine();
|
||||
//};
|
||||
//db.Aop.OnError = (ex) =>
|
||||
//{
|
||||
// Log.Error(UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, ex.Sql, (SugarParameter[])ex.Parametres));
|
||||
//};
|
||||
});
|
||||
// // 设置超时时间
|
||||
// db.Ado.CommandTimeOut = 30;
|
||||
// db.Aop.OnLogExecuted = (sql, pars) =>
|
||||
// {
|
||||
// var oldColor = Console.ForegroundColor;
|
||||
// Console.ForegroundColor = ConsoleColor.Green;
|
||||
// var finalSql = UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, sql, pars);
|
||||
// Console.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss.fff")}——SQL执行完成】{db.Ado.SqlExecutionTime.TotalMilliseconds} ms");
|
||||
// if (db.Ado.SqlExecutionTime.TotalMilliseconds > 3000)
|
||||
// {
|
||||
// Log.Warning($"慢查询: {db.Ado.SqlExecutionTime.TotalMilliseconds}ms, SQL: " + finalSql);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Console.WriteLine(finalSql);
|
||||
// Console.ForegroundColor = oldColor;
|
||||
// Console.WriteLine();
|
||||
// }
|
||||
// };
|
||||
// db.Aop.OnError = (ex) =>
|
||||
// {
|
||||
// Log.Error(UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, ex.Sql, (SugarParameter[])ex.Parametres));
|
||||
// };
|
||||
//});
|
||||
});
|
||||
services.AddUnitOfWork<SqlSugarUnitOfWork>();
|
||||
services.AddConfigurableOptions<ConnectionStringsOptions>();
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<ProjectReference Include="..\..\system\Tnb.Systems\Tnb.Systems.csproj" />
|
||||
<ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" />
|
||||
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev\Tnb.VisualDev.csproj" />
|
||||
<ProjectReference Include="..\..\visualdev\Tnb.Vmodel\Tnb.VmodelEngine.csproj" />
|
||||
<ProjectReference Include="..\..\WarehouseMgr\Tnb.WarehouseMgr\Tnb.WarehouseMgr.csproj" />
|
||||
<ProjectReference Include="..\..\workflow\Tnb.WorkFlow\Tnb.WorkFlow.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user