- 修复 本地区域化后 ToSql 产生的错误,比如数字可能生成 SQL 为:100,000;

This commit is contained in:
28810
2020-03-27 16:26:59 +08:00
parent ff61607e01
commit 7229c08d0d
4 changed files with 155 additions and 2 deletions

View File

@ -11,6 +11,7 @@ using System.Text;
using System.Text.RegularExpressions;
using FreeSql.DataAnnotations;
using System.Threading;
using System.Globalization;
namespace FreeSql.Internal
{
@ -1501,7 +1502,8 @@ namespace FreeSql.Internal
mapType ?? mapColumn?.Attribute.MapType ?? obj?.GetType(), mapType == null ? obj : Utils.GetDataReaderValue(mapType, obj));
return _common.QuoteParamterName(paramName);
}
return string.Concat(_ado.AddslashesProcessParam(obj, mapType, mapColumn));
return string.Format(CultureInfo.InvariantCulture, "{0}", _ado.AddslashesProcessParam(obj, mapType, mapColumn));
//return string.Concat(_ado.AddslashesProcessParam(obj, mapType, mapColumn));
}
}
}

View File

@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
@ -22,7 +23,7 @@ namespace FreeSql.Internal.CommonProvider
.Replace(filter, $" IS {{{a}}}");
nparms[a] = AddslashesProcessParam(parms[a], null, null);
}
try { string ret = string.Format(filter, nparms); return ret; } catch { return filter; }
try { string ret = string.Format(CultureInfo.InvariantCulture, filter, nparms); return ret; } catch { return filter; }
}
static ConcurrentDictionary<int, Regex> _dicAddslashesReplaceIsNull = new ConcurrentDictionary<int, Regex>();