-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UseGenerateCommandParameterWithLambda(true)时子语句的参数没整合到主语句 #231
Comments
好的,UseGenerateCommandParameterWithLambda 可能还有其他问题存在 |
回复了, var id = 1; //主语句变量
var itemId = 1; //子语句变量
var edi = fsql.Select<Edi>()
.Where(a=>a.Id == id)
.Where(a=>fsql.Select<EdiItem>().Where(b=>b.Id==itemId).Any())
.First(a=>a);
WriteLine(edi.Id); SELECT TOP 1 a.[EDI_ID] as1
FROM [EDI] a
WHERE (a.[EDI_ID] = @exp_0) AND (exists(SELECT TOP 1 1
FROM [EDI_ITEM] b
WHERE (b.[EDII_ID] = @exp_0)))
--两个都是@exp_0了 |
这是一个问题,只要把两个 IFreeSql._dbParams 弄成一个引用就好了 |
var itemId2 = 2;
var itemId = 1;
var edi = g.sqlite.Select<Edi>()
.Where(a => a.Id == itemId2 && g.sqlite.Select<EdiItem>().Where(b => b.Id == itemId).Any())
.First(a => a); //#231 SELECT a."EDI_ID" as1
FROM "EDI" a
WHERE (a."EDI_ID" = @exp_0 AND exists(SELECT 1
FROM "EDI_ITEM" b
WHERE (b."EDII_ID" = @exp_1)
limit 0,1))
limit 0,1 |
2881099
pushed a commit
that referenced
this issue
Mar 12, 2020
- 增加 ISelect.RawJoin 方法以便实现 Outer Apply 查询;#200
圆满了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
会报
必须声明标量变量 "@exp_0"
看DbCommand中 参数个数为0
生成sql没有问题。
The text was updated successfully, but these errors were encountered: