- 增加 ISelect ToDelete/ToUpdate 方法,实现更复杂的删除/更新操作;

This commit is contained in:
28810
2019-10-30 20:35:42 +08:00
parent db7fe82403
commit 21b4b0d5d3
21 changed files with 1594 additions and 9 deletions

View File

@ -62,7 +62,11 @@ namespace FreeSql.Odbc.SqlServer
var sb = new StringBuilder();
var news = new string[objs.Length];
for (var a = 0; a < objs.Length; a++)
news[a] = types[a] == typeof(string) ? objs[a] : $"cast({objs[a]} as nvarchar)";
{
if (types[a] == typeof(string)) news[a] = objs[a];
else if (types[a].NullableTypeOrThis() == typeof(Guid)) news[a] = $"cast({objs[a]} as char(36))";
else news[a] = $"cast({objs[a]} as nvarchar)";
}
return string.Join(" + ", news);
}
public override string Mod(string left, string right, Type leftType, Type rightType) => $"{left} % {right}";