Class DataReaderDecoratorExtensions
Extension methods for the IDataReader interface hidden behind the IDecorator<T> interface.
public static class DataReaderDecoratorExtensions
- Inheritance
-
DataReaderDecoratorExtensions
Methods
ToEncodedString(IDecorator<IDataReader>)
Converts the enclosed IDataReader of the decorator
to an equivalent string representation.
public static string ToEncodedString(this IDecorator<IDataReader> decorator)
Parameters
decorator
IDecorator<IDataReader>The IDecorator<T> to extend.
Returns
- string
A string value that is equivalent to the enclosed IDataReader of the
decorator
.
Remarks
IDataReader must return only one field (for instance, an XML field), otherwise an ArgumentException is thrown.
Exceptions
- ArgumentNullException
decorator
is null or its underlying value is null.- ArgumentOutOfRangeException
decorator
underlying value is not valid.
ToEncodedStringAsync(IDecorator<IDataReader>)
Asynchronously converts the enclosed IDataReader of the decorator
to an equivalent string representation.
public static Task<string> ToEncodedStringAsync(this IDecorator<IDataReader> decorator)
Parameters
decorator
IDecorator<IDataReader>The IDecorator<T> to extend.
Returns
- Task<string>
A task that represents the asynchronous operation. The task result contains a string value that is equivalent to the enclosed IDataReader of the
decorator
.
Remarks
IDataReader must return only one field (for instance, an XML field), otherwise an ArgumentException is thrown.
Exceptions
- ArgumentNullException
decorator
is null or its underlying value is null.- ArgumentOutOfRangeException
decorator
underlying value is not valid.
ToStream(IDecorator<IDataReader>)
Converts the enclosed IDataReader of the decorator
to an equivalent Stream representation.
public static Stream ToStream(this IDecorator<IDataReader> decorator)
Parameters
decorator
IDecorator<IDataReader>The IDecorator<T> to extend.
Returns
- Stream
A Stream that is equivalent to the enclosed IDataReader of the
decorator
.
Remarks
IDataReader must return only one field (for instance, an XML field), otherwise an ArgumentException is thrown.
Exceptions
- ArgumentNullException
decorator
is null or its underlying value is null.- ArgumentOutOfRangeException
decorator
underlying value is not valid.