修复清理vengine
This commit is contained in:
@@ -1,30 +1,32 @@
|
||||
using JNPF;
|
||||
using System.Collections.Concurrent;
|
||||
using JNPF;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.DependencyInjection;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using SqlSugar;
|
||||
using System.Collections.Concurrent;
|
||||
using Tnb.Core;
|
||||
using Tnb.Vengine.Domain;
|
||||
|
||||
namespace Tnb.Vengine.DataAccess;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
public class DataAccess : IDataAccess, ITransient, IDisposable
|
||||
{
|
||||
const int MAX_PAGE_SIZE = 1000;
|
||||
private const int MAX_PAGE_SIZE = 1000;
|
||||
private ISqlSugarClient? _db;
|
||||
|
||||
protected ISqlSugarClient Db
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_db == null)
|
||||
{
|
||||
var dbType = App.Configuration.GetConnectionString("DbType");
|
||||
var dbConn = App.Configuration.GetConnectionString("DbConn");
|
||||
_db = SugarHelper.CreateSugarClient("_db_default_", dbType, dbConn);
|
||||
ConnectionStringsOptions conn = App.GetConfig<ConnectionStringsOptions>("ConnectionStrings", true);
|
||||
//var dbType = App.Configuration.GetConnectionString("DbType");
|
||||
//var dbConn = App.Configuration.GetConnectionString("DbConn");
|
||||
_db = SugarHelper.CreateSugarClient(conn.ConfigId, conn.DBType, conn.ConnectString);
|
||||
}
|
||||
return _db;
|
||||
}
|
||||
@@ -35,7 +37,7 @@ public class DataAccess : IDataAccess, ITransient, IDisposable
|
||||
/// <summary>
|
||||
/// 全局缓存
|
||||
/// </summary>
|
||||
static ConcurrentDictionary<string, ISqlSugarClient> DbCache = new ConcurrentDictionary<string, ISqlSugarClient>();
|
||||
private static ConcurrentDictionary<string, ISqlSugarClient> DbCache = new ConcurrentDictionary<string, ISqlSugarClient>();
|
||||
|
||||
/// <summary>
|
||||
/// 构造
|
||||
@@ -290,9 +292,7 @@ public class DataAccess : IDataAccess, ITransient, IDisposable
|
||||
{
|
||||
ret.Add(prop.navCode, new List<DObject>());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@@ -424,5 +424,4 @@ public class DataAccess : IDataAccess, ITransient, IDisposable
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user