Browse Source

Update .net core version

pull/19/head
sunkaixuan 3 years ago
parent
commit
8e7ae2a359
  1. 9
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  2. 3
      Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs
  3. 5
      Src/Asp.NetCore2/SqlSugar/Realization/Oracle/OracleProvider.cs
  4. 4
      Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs

9
Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

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

3
Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs

@ -675,9 +675,12 @@ namespace SqlSugar
result += (TableShortName + UtilConstants.Space);
}
if (this.TableWithString.HasValue() && this.TableWithString != SqlWith.Null)
{
if (!result.TrimStart().StartsWith("("))
{
result += TableWithString + UtilConstants.Space;
}
}
if (!this.IsSingle())
{
result += GetJoinValueString + UtilConstants.Space;

5
Src/Asp.NetCore2/SqlSugar/Realization/Oracle/OracleProvider.cs

@ -203,6 +203,11 @@ namespace SqlSugar
sqlParameter.Value = parameter.Value;
sqlParameter.DbType = System.Data.DbType.DateTime;
}
else if (parameter.DbType == System.Data.DbType.Date)
{
sqlParameter.Value = parameter.Value;
sqlParameter.DbType = System.Data.DbType.Date;
}
else if (parameter.DbType == System.Data.DbType.AnsiStringFixedLength)
{
sqlParameter.DbType = System.Data.DbType.AnsiStringFixedLength;

4
Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs

@ -119,6 +119,10 @@ namespace SqlSugar
{
sqlParameter.NpgsqlDbType = NpgsqlDbType.Integer | NpgsqlDbType.Array;
}
else if (parameter.DbType.IsIn(System.Data.DbType.Int16))
{
sqlParameter.NpgsqlDbType = NpgsqlDbType.Smallint | NpgsqlDbType.Array;
}
else if (parameter.DbType.IsIn(System.Data.DbType.Int64))
{
sqlParameter.NpgsqlDbType = NpgsqlDbType.Bigint | NpgsqlDbType.Array;

Loading…
Cancel
Save