mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 完善 ISelect<T>.WithSql 方法,支持传入参数化 #413;
This commit is contained in:
@ -1043,14 +1043,23 @@ WHERE (((cast(a.[Id] as nvarchar(100))) in (SELECT b.[Title]
|
||||
});
|
||||
|
||||
var testUnionAll = select
|
||||
.WithSql("SELECT * FROM [tb_topic22] where id = 10")
|
||||
.WithSql("SELECT * FROM [tb_topic22] where id = 11")
|
||||
.WithSql("SELECT * FROM [tb_topic22] where id = @id1", new { id1 = 10 })
|
||||
.WithSql("SELECT * FROM [tb_topic22] where id = @id2", new { id2 = 11 })
|
||||
.ToSql(a => new
|
||||
{
|
||||
a.Id,
|
||||
a.Clicks
|
||||
});
|
||||
|
||||
var testUnionAllToList = select
|
||||
.WithSql("SELECT * FROM [tb_topic22] where id = @id1", new { id1 = 10 })
|
||||
.WithSql("SELECT * FROM [tb_topic22] where id = @id2", new { id2 = 11 })
|
||||
.ToList(a => new
|
||||
{
|
||||
a.Id,
|
||||
a.Clicks
|
||||
});
|
||||
|
||||
var testUnionAll2 = g.sqlite.Select<object>()
|
||||
.WithSql("SELECT * FROM [tb_topic22] where id = 10")
|
||||
.WithSql("SELECT * FROM [tb_topic22] where id = 11")
|
||||
|
Reference in New Issue
Block a user