Skip to content

Commit 31503d3

Browse files
committed
Fix documentation about GetFieldValueAsync.
1 parent 74cdcba commit 31503d3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/content/tutorials/best-practices.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,9 @@ should be familiar with [Async/Await - Best Practices in Asynchronous Programmin
5454
<td>ExecuteScalar</td>
5555
</tr>
5656
<tr>
57-
<td rowspan="4" style="vertical-align:middle">
57+
<td rowspan="3" style="vertical-align:middle">
5858
<a href="https://docs.microsoft.com/en-us/dotnet/core/api/system.data.common.dbdatareader">DbDataReader</a>
5959
</td>
60-
<td>GetFieldValueAsync</td>
61-
<td>GetFieldValue</td>
62-
</tr>
63-
<tr>
6460
<td>IsDBNullAsync</td>
6561
<td>IsDBNull</td>
6662
</tr>
@@ -92,6 +88,13 @@ should be familiar with [Async/Await - Best Practices in Asynchronous Programmin
9288
<span class="text-danger">*</span>Async Transaction methods are not part of ADO.NET, they are provided by
9389
MySqlConnector to allow database code to remain fully asynchronous.
9490

91+
### Exception: DbDataReader.GetFieldValueAsync
92+
93+
Once `DbDataReader.ReadAsync` (or `DbDataReader.Read`) has returned `true`, the full contents of the current
94+
row are will be memory. Calling `GetFieldValue<T>` will return the value immediately (without blocking on I/O).
95+
It will have higher performance than `GetFieldValueAsync<T>` because it doesn't have to allocate a `Task<T>`
96+
to store the result. There is no performance benefit to using the `DbDataReader.GetFieldValueAsync<T>` method.
97+
9598
### Example Console Application
9699

97100
In order to get the full benefit of asynchronous operation, every method in the call stack that eventually calls

0 commit comments

Comments
 (0)