修复Oracle查询带引号

This commit is contained in:
wintel 2024-03-09 19:50:00 +08:00
parent 71b72ca06e
commit e07d7e0cd2
3 changed files with 6 additions and 3 deletions

View File

@ -35,7 +35,8 @@ namespace OpenAuth.App
public T Get(string id)
{
if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL
|| SugarClient.CurrentConnectionConfig.DbType == DbType.Oracle)
{
return SugarClient.Queryable<T>().Where("\"Id\"=@id", new {id = id}).First();
}

View File

@ -85,7 +85,8 @@ namespace OpenAuth.App
}
var columnnames = columnFields.Select(u => u.ColumnName);
if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL
|| SugarClient.CurrentConnectionConfig.DbType == DbType.Oracle)
{
columnnames = columnFields.Select(u => "\"" + u.ColumnName +"\"");
}

View File

@ -41,7 +41,8 @@ namespace OpenAuth.App
}
var columnnames = columnFields.Select(u => u.ColumnName);
if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL
|| SugarClient.CurrentConnectionConfig.DbType == DbType.Oracle)
{
columnnames = columnFields.Select(u => "\"" + u.ColumnName +"\"");
}