DbDataReader.GetColumnSchemaAsync(CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This is the asynchronous version of GetColumnSchema(DbDataReader).
Providers should override with an appropriate implementation.
The cancellationToken
can optionally be honored.
The default implementation invokes the synchronous GetColumnSchema(DbDataReader) call and returns a completed task.
The default implementation will return a cancelled task if passed an already cancelled cancellationToken
.
Exceptions thrown by GetColumnSchema(DbDataReader) will be communicated via the returned Task Exception property.
public virtual System.Threading.Tasks.Task<System.Collections.ObjectModel.ReadOnlyCollection<System.Data.Common.DbColumn>> GetColumnSchemaAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetColumnSchemaAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.ObjectModel.ReadOnlyCollection<System.Data.Common.DbColumn>>
override this.GetColumnSchemaAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.ObjectModel.ReadOnlyCollection<System.Data.Common.DbColumn>>
Public Overridable Function GetColumnSchemaAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of ReadOnlyCollection(Of DbColumn))
Parameters
- cancellationToken
- CancellationToken
The cancellation instruction.
Returns
A task representing the asynchronous operation.
Exceptions
The cancellation token was canceled. This exception is stored into the returned task.