From dfabbf0c52c41a69baa098a5f9d8a64021a39039 Mon Sep 17 00:00:00 2001 From: Wei Date: Wed, 27 Dec 2023 12:04:37 +0800 Subject: [PATCH] [doc] update dapper query description --- README.md | 5 +++-- README.zh-CN.md | 2 +- README.zh-Hant.md | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bf966f38..ac08c1cf 100644 --- a/README.md +++ b/README.md @@ -413,8 +413,9 @@ using (var connection = GetConnection(connectionString)) var rows = connection.Query( new CommandDefinition( @"select 'MiniExcel' as Column1,1 as Column2 union all select 'Github',2" - , CommandFlags.NoCache) - ) + , flags: CommandFlags.NoCache) + ); + // Note: QueryAsync will throw close connection exception MiniExcel.SaveAs(path, rows); } ``` diff --git a/README.zh-CN.md b/README.zh-CN.md index 5d347d94..df6987b6 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -424,7 +424,7 @@ using (var connection = GetConnection(connectionString)) new CommandDefinition( @"select 'MiniExcel' as Column1,1 as Column2 union all select 'Github',2" , flags: CommandFlags.NoCache) - ) + ); MiniExcel.SaveAs(path, rows); } ``` diff --git a/README.zh-Hant.md b/README.zh-Hant.md index 0b4beebd..13305723 100644 --- a/README.zh-Hant.md +++ b/README.zh-Hant.md @@ -417,11 +417,12 @@ using (var connection = GetConnection(connectionString)) var rows = connection.Query( new CommandDefinition( @"select 'MiniExcel' as Column1,1 as Column2 union all select 'Github',2" - , CommandFlags.NoCache) - ) + , flags: CommandFlags.NoCache) + ); MiniExcel.SaveAs(path, rows); } ``` +上面的方法已知的問題:不能使用異步QueryAsync的方法,會報連接已經關閉的異常 以下寫法會將數據全載入內存