Skip to content

Commit

Permalink
Fix documentation about GetFieldValueAsync.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Jun 1, 2017
1 parent 74cdcba commit 31503d3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/content/tutorials/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,9 @@ should be familiar with [Async/Await - Best Practices in Asynchronous Programmin
<td>ExecuteScalar</td>
</tr>
<tr>
<td rowspan="4" style="vertical-align:middle">
<td rowspan="3" style="vertical-align:middle">
<a href="https://docs.microsoft.com/en-us/dotnet/core/api/system.data.common.dbdatareader">DbDataReader</a>
</td>
<td>GetFieldValueAsync</td>
<td>GetFieldValue</td>
</tr>
<tr>
<td>IsDBNullAsync</td>
<td>IsDBNull</td>
</tr>
Expand Down Expand Up @@ -92,6 +88,13 @@ should be familiar with [Async/Await - Best Practices in Asynchronous Programmin
<span class="text-danger">*</span>Async Transaction methods are not part of ADO.NET, they are provided by
MySqlConnector to allow database code to remain fully asynchronous.

### Exception: DbDataReader.GetFieldValueAsync

Once `DbDataReader.ReadAsync` (or `DbDataReader.Read`) has returned `true`, the full contents of the current
row are will be memory. Calling `GetFieldValue<T>` will return the value immediately (without blocking on I/O).
It will have higher performance than `GetFieldValueAsync<T>` because it doesn't have to allocate a `Task<T>`
to store the result. There is no performance benefit to using the `DbDataReader.GetFieldValueAsync<T>` method.

### Example Console Application

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

0 comments on commit 31503d3

Please sign in to comment.