PgSQL InvariantCulture

This commit is contained in:
sunkaixuan 2025-03-31 17:51:11 +08:00
parent cea5214f15
commit 7353e5a0d9
2 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,5 @@
using System;
using System.Globalization;
using System.Linq;
using System.Text;
@ -229,6 +230,10 @@ namespace SqlSugar
{
return N + "'" + Convert.ToDouble(value).ToString() + "'";
}
else if (value is decimal v)
{
return v.ToString(CultureInfo.InvariantCulture);
}
else
{
return N + "'" + value.ToString() + "'";

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
@ -43,15 +44,15 @@ namespace SqlSugar
else
{
var type =UtilMethods.GetUnderType(value.GetType());
if (type == UtilConstants.ByteArrayType||type == UtilConstants.DateType||columnInfo.IsArray||columnInfo.IsJson)
if (type == UtilConstants.ByteArrayType || type == UtilConstants.DateType || columnInfo.IsArray || columnInfo.IsJson)
{
var parameterName = this.Builder.SqlParameterKeyWord + name +"_"+ i;
var parameterName = this.Builder.SqlParameterKeyWord + name + "_" + i;
var paramter = new SugarParameter(parameterName, value);
if (columnInfo.IsJson)
if (columnInfo.IsJson)
{
paramter.IsJson = true;
}
if (columnInfo.IsArray)
if (columnInfo.IsArray)
{
paramter.IsArray = true;
}
@ -86,6 +87,10 @@ namespace SqlSugar
{
return "'" + value.ToString().ToSqlFilter() + "'";
}
else if (value is decimal v)
{
return v.ToString(CultureInfo.InvariantCulture);
}
else
{
return "'" + value.ToString() + "'";