From 31503d3dd848cc633f41a3224cd0f9d7ae198954 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Wed, 31 May 2017 21:25:44 -0700 Subject: [PATCH] Fix documentation about GetFieldValueAsync. --- docs/content/tutorials/best-practices.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/content/tutorials/best-practices.md b/docs/content/tutorials/best-practices.md index 8780afe9b..eda5f1583 100644 --- a/docs/content/tutorials/best-practices.md +++ b/docs/content/tutorials/best-practices.md @@ -54,13 +54,9 @@ should be familiar with [Async/Await - Best Practices in Asynchronous Programmin ExecuteScalar - + DbDataReader - GetFieldValueAsync - GetFieldValue - - IsDBNullAsync IsDBNull @@ -92,6 +88,13 @@ should be familiar with [Async/Await - Best Practices in Asynchronous Programmin *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` will return the value immediately (without blocking on I/O). +It will have higher performance than `GetFieldValueAsync` because it doesn't have to allocate a `Task` +to store the result. There is no performance benefit to using the `DbDataReader.GetFieldValueAsync` method. + ### Example Console Application In order to get the full benefit of asynchronous operation, every method in the call stack that eventually calls