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

Dapper Query 支持延迟加载,README.zh-CN.md 文件中的说法错误 #552

Closed
shaofing opened this issue Dec 26, 2023 · 4 comments
Closed

Comments

@shaofing
Copy link
Contributor

shaofing commented Dec 26, 2023

README.zh-CN.md 文件中的说法错误
https://github.com/mini-software/MiniExcel/blob/master/README.zh-CN.md#5-dapper-query

var details = conn.Query<receipt_detail>(new CommandDefinition(sql, CommandFlags.NoCache)); //必须使用NoCache

使用new CommandDefinition(sql, CommandFlags.NoCache) 可以支持延迟加载

@shaofing shaofing changed the title Dapper Query 自持文档 Dapper Query 支持延迟加载,README.zh-CN.md 文件中的说法错误 Dec 26, 2023
@shps951023
Copy link
Member

@shaofing 谢谢👍
已更正说法

@shaofing
Copy link
Contributor Author

1 ,上面的demo写法不对 , flags 前面还有可选参数,如果不按照顺序写 ,参数得是 new CommandDefinition(sql, flags: CommandFlags.NoCache)
2,不能ToList() 。
3,使用CommandFlags.NoCache时,不能使用异步QueryAsync的方法,会报连接已经关闭的异常
var details = conn.Query<receipt_detail>(new CommandDefinition(sql, flags: CommandFlags.NoCache)); MiniExcel.SaveAs(fileName, details);

@shps951023
Copy link
Member

@shaofing 请问能帮忙PR吗?

@shaofing
Copy link
Contributor Author

#554

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