mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-12-24 01:25:48 +08:00
- 兼容 SqlServer varchar/nvarchar 表达式解析,分别解析为:N'' 和 '';
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using FreeSql.Internal.Model;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@@ -6,7 +7,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
partial class AdoProvider
|
||||
{
|
||||
public abstract object AddslashesProcessParam(object param, Type mapType);
|
||||
public abstract object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn);
|
||||
public string Addslashes(string filter, params object[] parms)
|
||||
{
|
||||
if (filter == null || parms == null) return string.Empty;
|
||||
@@ -17,7 +18,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
if (parms[a] == null)
|
||||
filter = _dicAddslashesReplaceIsNull.GetOrAdd(a, b => new Regex(@"\s*(=|IN)\s*\{" + b + @"\}", RegexOptions.IgnoreCase | RegexOptions.Compiled))
|
||||
.Replace(filter, $" IS {{{a}}}");
|
||||
nparms[a] = AddslashesProcessParam(parms[a], null);
|
||||
nparms[a] = AddslashesProcessParam(parms[a], null, null);
|
||||
}
|
||||
try { string ret = string.Format(filter, nparms); return ret; } catch { return filter; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user