- 优化 WhereDynamic 传入 string 的时候自动转为主键的类型值;

This commit is contained in:
28810
2020-04-21 16:55:32 +08:00
parent c09173e8a3
commit 50eba05c15
3 changed files with 135 additions and 176 deletions

View File

@ -276,6 +276,10 @@ namespace FreeSql.Internal
}
return sb.ToString();
}
else if (primarys.Length == 1 && type == typeof(string))
{
return $"{aliasAndDot}{this.QuoteSqlName(pk1.Attribute.Name)} = {this.FormatSql("{0}", Utils.GetDataReaderValue(pk1.Attribute.MapType, dywhere))}";
}
else if (dywhere is IEnumerable)
{
var sb = new StringBuilder();