Update .net core project

This commit is contained in:
sunkaixuan 2022-06-17 14:48:34 +08:00
parent 08d33fe8aa
commit 5c32ae7e94
4 changed files with 11 additions and 7 deletions

View File

@ -15,7 +15,7 @@ namespace SqlSugar
}
public virtual List<DbTableInfo> GetViewInfoList(bool isCache = true)
{
string cacheKey = "DbMaintenanceProvider.GetViewInfoList";
string cacheKey = "DbMaintenanceProvider.GetViewInfoList" + this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey);
var result = new List<DbTableInfo>();
if (isCache)
@ -30,7 +30,7 @@ namespace SqlSugar
}
public virtual List<DbTableInfo> GetTableInfoList(bool isCache = true)
{
string cacheKey = "DbMaintenanceProvider.GetTableInfoList";
string cacheKey = "DbMaintenanceProvider.GetTableInfoList"+this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey);
var result = new List<DbTableInfo>();
if (isCache)
@ -46,7 +46,7 @@ namespace SqlSugar
public virtual List<DbColumnInfo> GetColumnInfosByTableName(string tableName, bool isCache = true)
{
if (string.IsNullOrEmpty(tableName)) return new List<DbColumnInfo>();
string cacheKey = "DbMaintenanceProvider.GetColumnInfosByTableName." + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower();
string cacheKey = "DbMaintenanceProvider.GetColumnInfosByTableName." + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower() + this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey);
var sql = string.Format(this.GetColumnInfosByTableNameSql, tableName);
if (isCache)
@ -57,7 +57,7 @@ namespace SqlSugar
}
public virtual List<string> GetIsIdentities(string tableName)
{
string cacheKey = "DbMaintenanceProvider.GetIsIdentities" + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower();
string cacheKey = "DbMaintenanceProvider.GetIsIdentities" + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower() + this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey);
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, () =>
{
@ -67,7 +67,7 @@ namespace SqlSugar
}
public virtual List<string> GetPrimaries(string tableName)
{
string cacheKey = "DbMaintenanceProvider.GetPrimaries" + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower();
string cacheKey = "DbMaintenanceProvider.GetPrimaries" + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower() + this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey);
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, () =>
{

View File

@ -2422,7 +2422,7 @@ namespace SqlSugar
if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Count==1)
{
var tableinfo = this.QueryBuilder.AsTables.First();
if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockQuery == true)
if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockQuery == true&& this.QueryBuilder.AsTables.First().Value.ObjToString().Contains(SqlWith.NoLock) ==false)
{
this.QueryBuilder.AsTables[tableinfo.Key] = " (SELECT * FROM " + this.QueryBuilder.AsTables.First().Value + $" {SqlWith.NoLock} )";
}

View File

@ -381,6 +381,9 @@ namespace SqlSugar
case DbType.PostgreSQL:
DependencyManagement.TryPostgreSQL();
break;
case DbType.OpenGauss:
Check.ExceptionEasy("Use DbType.PostgreSQL , ConnectionString add No Reset On Close=true", "OpenGausso数据库可以使用DbType.PostgreSQL 并且连接字符串加上 No Reset On Close=true");
break;
case DbType.Kdbndp:
DependencyManagement.TryKdbndb();
break;

View File

@ -17,6 +17,7 @@ namespace SqlSugar
Oscar,
MySqlConnector,
Access,
Custom=900
OpenGauss,
Custom =900
}
}