CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Data.SqlClient.SafeSqlDataReader Class Reference

This is a SqlDataReader that 'fixes' any null values before they are returned to our business code. More...

Inheritance diagram for Csla.Data.SqlClient.SafeSqlDataReader:
Csla.Data.SafeDataReader

Public Member Functions

 SafeSqlDataReader (IDataReader dataReader)
 Initializes the SafeDataReader object to use data from the provided DataReader object. More...
 
Task< T > GetFieldValueAsync< T > (int ordinal)
 Asynchronously gets the data value as a type. More...
 
Task< T > GetFieldValueAsync< T > (int ordinal, System.Threading.CancellationToken cancellationToken)
 Asynchronously gets the data value as a type. More...
 
Task< bool > IsDbNullAsync (int ordinal)
 Gets a value indicating whether the column has a null or missing value. More...
 
Task< bool > IsDbNullAsync (int ordinal, System.Threading.CancellationToken cancellationToken)
 Gets a value indicating whether the column has a null or missing value. More...
 
Task< bool > NextResultAsync ()
 Advances the reader to the next result. More...
 
Task< bool > NextResultAsync (System.Threading.CancellationToken cancellationToken)
 Advances the reader to the next result. More...
 
Task< bool > ReadAsync ()
 Advances to the next record in a recordset. More...
 
Task< bool > ReadAsync (System.Threading.CancellationToken cancellationToken)
 Advances to the next record in a recordset. More...
 
- Public Member Functions inherited from Csla.Data.SafeDataReader
 SafeDataReader (IDataReader dataReader)
 Initializes the SafeDataReader object to use data from the provided DataReader object. More...
 
Task< T > GetFieldValueAsync< T > (int ordinal)
 Asynchronously gets the data value as a type. More...
 
Task< T > GetFieldValueAsync< T > (int ordinal, System.Threading.CancellationToken cancellationToken)
 Asynchronously gets the data value as a type. More...
 
Task< bool > IsDbNullAsync (int ordinal)
 Gets a value indicating whether the column has a null or missing value. More...
 
Task< bool > IsDbNullAsync (int ordinal, System.Threading.CancellationToken cancellationToken)
 Gets a value indicating whether the column has a null or missing value. More...
 
Task< bool > NextResultAsync ()
 Advances the reader to the next result. More...
 
Task< bool > NextResultAsync (System.Threading.CancellationToken cancellationToken)
 Advances the reader to the next result. More...
 
Task< bool > ReadAsync ()
 Advances to the next record in a recordset. More...
 
Task< bool > ReadAsync (System.Threading.CancellationToken cancellationToken)
 Advances to the next record in a recordset. More...
 
string GetString (string name)
 Gets a string value from the datareader. More...
 
virtual string GetString (int i)
 Gets a string value from the datareader. More...
 
object GetValue (string name)
 Gets a value of type System.Object from the datareader. More...
 
virtual object GetValue (int i)
 Gets a value of type System.Object from the datareader. More...
 
int GetInt32 (string name)
 Gets an integer from the datareader. More...
 
virtual int GetInt32 (int i)
 Gets an integer from the datareader. More...
 
double GetDouble (string name)
 Gets a double from the datareader. More...
 
virtual double GetDouble (int i)
 Gets a double from the datareader. More...
 
Csla.SmartDate GetSmartDate (string name)
 Gets a SmartDate from the datareader. More...
 
virtual Csla.SmartDate GetSmartDate (int i)
 Gets a SmartDate from the datareader. More...
 
Csla.SmartDate GetSmartDate (string name, bool minIsEmpty)
 Gets a SmartDate from the datareader. More...
 
virtual Csla.SmartDate GetSmartDate (int i, bool minIsEmpty)
 Gets a SmartDate from the datareader. More...
 
System.Guid GetGuid (string name)
 Gets a Guid value from the datareader. More...
 
virtual System.Guid GetGuid (int i)
 Gets a Guid value from the datareader. More...
 
bool Read ()
 Reads the next row of data from the datareader. More...
 
bool NextResult ()
 Moves to the next result set in the datareader. More...
 
void Close ()
 Closes the datareader. More...
 
bool GetBoolean (string name)
 Gets a boolean value from the datareader. More...
 
virtual bool GetBoolean (int i)
 Gets a boolean value from the datareader. More...
 
byte GetByte (string name)
 Gets a byte value from the datareader. More...
 
virtual byte GetByte (int i)
 Gets a byte value from the datareader. More...
 
Int64 GetBytes (string name, Int64 fieldOffset, byte[] buffer, int bufferOffset, int length)
 Invokes the GetBytes method of the underlying datareader. More...
 
virtual Int64 GetBytes (int i, Int64 fieldOffset, byte[] buffer, int bufferOffset, int length)
 Invokes the GetBytes method of the underlying datareader. More...
 
char GetChar (string name)
 Gets a char value from the datareader. More...
 
virtual char GetChar (int i)
 Gets a char value from the datareader. More...
 
Int64 GetChars (string name, Int64 fieldOffset, char[] buffer, int bufferOffset, int length)
 Invokes the GetChars method of the underlying datareader. More...
 
virtual Int64 GetChars (int i, Int64 fieldOffset, char[] buffer, int bufferOffset, int length)
 Invokes the GetChars method of the underlying datareader. More...
 
IDataReader GetData (string name)
 Invokes the GetData method of the underlying datareader. More...
 
virtual IDataReader GetData (int i)
 Invokes the GetData method of the underlying datareader. More...
 
string GetDataTypeName (string name)
 Invokes the GetDataTypeName method of the underlying datareader. More...
 
virtual string GetDataTypeName (int i)
 Invokes the GetDataTypeName method of the underlying datareader. More...
 
virtual DateTime GetDateTime (string name)
 Gets a date value from the datareader. More...
 
virtual DateTime GetDateTime (int i)
 Gets a date value from the datareader. More...
 
virtual DateTimeOffset GetDateTimeOffset (string name)
 Gets an UTC date value from the datareader. More...
 
virtual DateTimeOffset GetDateTimeOffset (int i)
 Gets an UTC date value from the datareader. More...
 
decimal GetDecimal (string name)
 Gets a decimal value from the datareader. More...
 
virtual decimal GetDecimal (int i)
 Gets a decimal value from the datareader. More...
 
Type GetFieldType (string name)
 Invokes the GetFieldType method of the underlying datareader. More...
 
virtual Type GetFieldType (int i)
 Invokes the GetFieldType method of the underlying datareader. More...
 
float GetFloat (string name)
 Gets a Single value from the datareader. More...
 
virtual float GetFloat (int i)
 Gets a Single value from the datareader. More...
 
short GetInt16 (string name)
 Gets a Short value from the datareader. More...
 
virtual short GetInt16 (int i)
 Gets a Short value from the datareader. More...
 
Int64 GetInt64 (string name)
 Gets a Long value from the datareader. More...
 
virtual Int64 GetInt64 (int i)
 Gets a Long value from the datareader. More...
 
virtual string GetName (int i)
 Invokes the GetName method of the underlying datareader. More...
 
int GetOrdinal (string name)
 Gets an ordinal value from the datareader. More...
 
DataTable GetSchemaTable ()
 Invokes the GetSchemaTable method of the underlying datareader. More...
 
int GetValues (object[] values)
 Invokes the GetValues method of the underlying datareader. More...
 
virtual bool IsDBNull (int i)
 Invokes the IsDBNull method of the underlying datareader. More...
 
virtual bool IsDBNull (string name)
 Invokes the IsDBNull method of the underlying datareader. More...
 
void Dispose ()
 Disposes the object. More...
 

Properties

SqlDataReader SqlDataReader [get]
 Get a reference to the underlying SqlDataReader if present. More...
 
- Properties inherited from Csla.Data.SafeDataReader
IDataReader DataReader [get]
 Get a reference to the underlying data reader object that actually contains the data from the data source. More...
 
int Depth [get]
 Returns the depth property value from the datareader. More...
 
int FieldCount [get]
 Returns the FieldCount property from the datareader. More...
 
bool IsClosed [get]
 Returns the IsClosed property value from the datareader. More...
 
object this[string name] [get]
 Returns a value from the datareader. More...
 
virtual object this[int i] [get]
 Returns a value from the datareader. More...
 
int RecordsAffected [get]
 Returns the RecordsAffected property value from the underlying datareader. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Csla.Data.SafeDataReader
virtual void Dispose (bool disposing)
 Disposes the object. More...
 

Detailed Description

This is a SqlDataReader that 'fixes' any null values before they are returned to our business code.

Definition at line 23 of file SafeSqlDataReader.cs.

Constructor & Destructor Documentation

◆ SafeSqlDataReader()

Csla.Data.SqlClient.SafeSqlDataReader.SafeSqlDataReader ( IDataReader  dataReader)

Initializes the SafeDataReader object to use data from the provided DataReader object.

Parameters
dataReaderThe source DataReader object containing the data.

Definition at line 36 of file SafeSqlDataReader.cs.

Member Function Documentation

◆ GetFieldValueAsync< T >() [1/2]

Task< T > Csla.Data.SqlClient.SafeSqlDataReader.GetFieldValueAsync< T > ( int  ordinal)

Asynchronously gets the data value as a type.

Template Parameters
TType of value
Parameters
ordinalOrdinal position of value
Returns

Definition at line 48 of file SafeSqlDataReader.cs.

◆ GetFieldValueAsync< T >() [2/2]

Task< T > Csla.Data.SqlClient.SafeSqlDataReader.GetFieldValueAsync< T > ( int  ordinal,
System.Threading.CancellationToken  cancellationToken 
)

Asynchronously gets the data value as a type.

Template Parameters
TType of value
Parameters
ordinalOrdinal position of value
cancellationTokenAsync cancellation token

Definition at line 61 of file SafeSqlDataReader.cs.

◆ IsDbNullAsync() [1/2]

Task< bool > Csla.Data.SqlClient.SafeSqlDataReader.IsDbNullAsync ( int  ordinal)

Gets a value indicating whether the column has a null or missing value.

Parameters
ordinalOrdinal position of value
Returns

Definition at line 74 of file SafeSqlDataReader.cs.

◆ IsDbNullAsync() [2/2]

Task< bool > Csla.Data.SqlClient.SafeSqlDataReader.IsDbNullAsync ( int  ordinal,
System.Threading.CancellationToken  cancellationToken 
)

Gets a value indicating whether the column has a null or missing value.

Parameters
ordinalOrdinal position of value
cancellationTokenAsync cancellation token
Returns

Definition at line 88 of file SafeSqlDataReader.cs.

◆ NextResultAsync() [1/2]

Task< bool > Csla.Data.SqlClient.SafeSqlDataReader.NextResultAsync ( )

Advances the reader to the next result.

Returns

Definition at line 99 of file SafeSqlDataReader.cs.

◆ NextResultAsync() [2/2]

Task< bool > Csla.Data.SqlClient.SafeSqlDataReader.NextResultAsync ( System.Threading.CancellationToken  cancellationToken)

Advances the reader to the next result.

Parameters
cancellationTokenAsync cancellation token
Returns

Definition at line 111 of file SafeSqlDataReader.cs.

◆ ReadAsync() [1/2]

Task< bool > Csla.Data.SqlClient.SafeSqlDataReader.ReadAsync ( )

Advances to the next record in a recordset.

Returns

Definition at line 122 of file SafeSqlDataReader.cs.

◆ ReadAsync() [2/2]

Task< bool > Csla.Data.SqlClient.SafeSqlDataReader.ReadAsync ( System.Threading.CancellationToken  cancellationToken)

Advances to the next record in a recordset.

Parameters
cancellationTokenAsync cancellation token
Returns

Definition at line 134 of file SafeSqlDataReader.cs.

Property Documentation

◆ SqlDataReader

SqlDataReader Csla.Data.SqlClient.SafeSqlDataReader.SqlDataReader
get

Get a reference to the underlying SqlDataReader if present.

Definition at line 29 of file SafeSqlDataReader.cs.