mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 增加 ISelect ToDelete/ToUpdate 方法,实现更复杂的删除/更新操作;
This commit is contained in:
@ -71,7 +71,11 @@ namespace FreeSql.Odbc.Default
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -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}";
|
||||
|
Reference in New Issue
Block a user