mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-12-24 01:25:48 +08:00
- 增加 Column.MapType 类型映射,可将 enum 映射为 int/string 等;
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace FreeSql.Internal.CommonProvider {
|
||||
partial class AdoProvider {
|
||||
|
||||
public abstract object AddslashesProcessParam(object param);
|
||||
public abstract object AddslashesProcessParam(object param, Type mapType);
|
||||
public string Addslashes(string filter, params object[] parms) {
|
||||
if (filter == null || parms == null) return string.Empty;
|
||||
if (parms.Length == 0) return filter;
|
||||
@@ -11,7 +11,7 @@ namespace FreeSql.Internal.CommonProvider {
|
||||
for (int a = 0; a < parms.Length; a++) {
|
||||
if (parms[a] == null)
|
||||
filter = Regex.Replace(filter, @"\s*(=|IN)\s*\{" + a + @"\}", " IS {" + a + "}", RegexOptions.IgnoreCase);
|
||||
nparms[a] = AddslashesProcessParam(parms[a]);
|
||||
nparms[a] = AddslashesProcessParam(parms[a], null);
|
||||
}
|
||||
try { string ret = string.Format(filter, nparms); return ret; } catch { return filter; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user