Class DataReaderDecoratorExtensions
- Namespace
- Cuemon.Data
- Assembly
- Cuemon.Data.dll
Extension methods for the System.Data.IDataReader interface hidden behind the IDecorator<T> interface.
public static class DataReaderDecoratorExtensions
- Inheritance
-
ObjectDataReaderDecoratorExtensions
Methods
ToEncodedString(IDecorator<IDataReader>)
Converts the enclosed System.Data.IDataReader of the decorator
to an equivalent System.String representation.
public static string ToEncodedString(this IDecorator<IDataReader> decorator)
Parameters
decorator
IDecorator<IDataReader>The IDecorator<T> to extend.
Returns
- String
A System.String value that is equivalent to the enclosed System.Data.IDataReader of the
decorator
.
Remarks
System.Data.IDataReader must return only one field (for instance, an XML field), otherwise an System.ArgumentException is thrown.
Exceptions
- System.ArgumentNullException
decorator
is null or its underlying value is null.- ArgumentOutOfRangeException
decorator
underlying value is not valid.
ToEncodedStringAsync(IDecorator<IDataReader>)
Asynchronously converts the enclosed System.Data.IDataReader of the decorator
to an equivalent System.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 System.String value that is equivalent to the enclosed System.Data.IDataReader of the
decorator
.
Remarks
System.Data.IDataReader must return only one field (for instance, an XML field), otherwise an System.ArgumentException is thrown.
Exceptions
- System.ArgumentNullException
decorator
is null or its underlying value is null.- ArgumentOutOfRangeException
decorator
underlying value is not valid.
ToStream(IDecorator<IDataReader>)
Converts the enclosed System.Data.IDataReader of the decorator
to an equivalent System.IO.Stream representation.
public static Stream ToStream(this IDecorator<IDataReader> decorator)
Parameters
decorator
IDecorator<IDataReader>The IDecorator<T> to extend.
Returns
- Stream
A System.IO.Stream that is equivalent to the enclosed System.Data.IDataReader of the
decorator
.
Remarks
System.Data.IDataReader must return only one field (for instance, an XML field), otherwise an System.ArgumentException is thrown.
Exceptions
- System.ArgumentNullException
decorator
is null or its underlying value is null.- ArgumentOutOfRangeException
decorator
underlying value is not valid.