Skip to content
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

WithTempQuery #1782

Open
ntzw opened this issue Apr 15, 2024 · 1 comment
Open

WithTempQuery #1782

ntzw opened this issue Apr 15, 2024 · 1 comment

Comments

@ntzw
Copy link

ntzw commented Apr 15, 2024

问题描述及重现代码:

WithTempQuery 查询时,用子表 Sum 不会赋值,但是在ToListAsync 子查询时会赋值

var withTempQuery = select.WithTempQuery(e => new Model(e)
        {
           
            DoneScoreCount = _freeSql.Select<Model>().Where(asr => asr.Num == e.Num).Count(),
            ZeroScoreCount = _freeSql.Select<Model>().Where(asr => asr.Num == e.Num && asr.Score <= 0).Count(),
           SelfScore = _freeSql.Select<Model>().Where(asr => asr.Num == e.Num).Sum(asr => asr.Score),
           
        });

数据库版本

SqlServer

安装的Nuget包

都是最新的 3.2.821

.net framework/. net core? 及具体版本

.net6

@2881099
Copy link
Collaborator

2881099 commented Apr 15, 2024

提供可以运行的demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants