- 增加 连接字符串错误时的友好提示;

This commit is contained in:
28810
2019-07-18 11:30:14 +08:00
parent 558d154486
commit de28c38d70
20 changed files with 110 additions and 50 deletions

View File

@ -426,7 +426,7 @@ namespace FreeSql.Internal
{
var enumType = leftMapColumn.CsType.NullableTypeOrThis();
if (enumType.IsEnum)
right = formatSql(Enum.Parse(enumType, right.Trim('\'')), leftMapColumn.Attribute.MapType);
right = formatSql(Enum.Parse(enumType, right.StartsWith("N'") ? right.Substring(1).Trim('\'') : right.Trim('\'')), leftMapColumn.Attribute.MapType);
}
if (leftMapColumn == null)
{
@ -440,7 +440,7 @@ namespace FreeSql.Internal
{
var enumType = rightMapColumn.CsType.NullableTypeOrThis();
if (enumType.IsEnum)
left = formatSql(Enum.Parse(enumType, left.Trim('\'')), rightMapColumn.Attribute.MapType);
left = formatSql(Enum.Parse(enumType, left.StartsWith("N'") ? left.Substring(1).Trim('\'') : left.Trim('\'')), rightMapColumn.Attribute.MapType);
}
}
}