- 完善 [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

@ -1,4 +1,5 @@
using FreeSql.Internal.Model;
using FreeSql.Internal;
using FreeSql.Internal.Model;
using System;
using System.Collections.Generic;
using System.Text;
@ -55,11 +56,7 @@ namespace FreeSql.Odbc.Default
public virtual string ByteRawSql(object value)
{
if (value == null) return "NULL";
var bytes = value as byte[];
var sb = new StringBuilder().Append("0x");
foreach (var vc in bytes)
sb.Append(vc.ToString("X").PadLeft(2, '0'));
return sb.ToString();
return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
}
public virtual string CastSql(string sql, string to) => $"cast({sql} as {to})";