- 完善 [Column(MapType = typeof(byte[]))] 对 Guid/string 的映射支持;

This commit is contained in:
28810
2020-01-07 00:41:22 +08:00
parent fbbd74f54c
commit 5afeea7711
33 changed files with 128 additions and 135 deletions

View File

@ -39,6 +39,7 @@ namespace FreeSql.MsAccess
if (param == null) return "NULL";
if (mapType != null && mapType != param.GetType() && (param is IEnumerable == false || mapType.IsArrayOrList()))
param = Utils.GetDataReaderValue(mapType, param);
if (param is bool || param is bool?)
return (bool)param ? -1 : 0;
else if (param is string || param is char)
@ -54,7 +55,9 @@ namespace FreeSql.MsAccess
}
else if (param is TimeSpan || param is TimeSpan?)
return ((TimeSpan)param).TotalSeconds;
else if (param is IEnumerable)
else if (param is byte[])
return $"0x{CommonUtils.BytesSqlRaw(param as byte[])}";
else if (param is IEnumerable)
return AddslashesIEnumerable(param, mapType, mapColumn);
return string.Concat("'", param.ToString().Replace("'", "''"), "'");