![]() |
CSLA .NET 10.0.0
A home for your business logic
|
This is an IDataReader that 'fixes' any null values before they are returned to our business code. More...
Public Member Functions | |
| SafeDataReader (IDataReader dataReader) | |
| Initializes the SafeDataReader object to use data from the provided DataReader object. | |
| string | GetString (string name) |
| Gets a string value from the datareader. | |
| virtual string | GetString (int i) |
| Gets a string value from the datareader. | |
| object? | GetValue (string name) |
| Gets a value of type System.Object from the datareader. | |
| virtual ? object | GetValue (int i) |
| Gets a value of type System.Object from the datareader. | |
| int | GetInt32 (string name) |
| Gets an integer from the datareader. | |
| virtual int | GetInt32 (int i) |
| Gets an integer from the datareader. | |
| double | GetDouble (string name) |
| Gets a double from the datareader. | |
| virtual double | GetDouble (int i) |
| Gets a double from the datareader. | |
| SmartDate | GetSmartDate (string name) |
| Gets a SmartDate from the datareader. | |
| virtual SmartDate | GetSmartDate (int i) |
| Gets a SmartDate from the datareader. | |
| SmartDate | GetSmartDate (string name, bool minIsEmpty) |
| Gets a SmartDate from the datareader. | |
| virtual SmartDate | GetSmartDate (int i, bool minIsEmpty) |
| Gets a SmartDate from the datareader. | |
| Guid | GetGuid (string name) |
| Gets a Guid value from the datareader. | |
| virtual Guid | GetGuid (int i) |
| Gets a Guid value from the datareader. | |
| bool | Read () |
| Reads the next row of data from the datareader. | |
| bool | NextResult () |
| Moves to the next result set in the datareader. | |
| void | Close () |
| Closes the datareader. | |
| bool | GetBoolean (string name) |
| Gets a boolean value from the datareader. | |
| virtual bool | GetBoolean (int i) |
| Gets a boolean value from the datareader. | |
| byte | GetByte (string name) |
| Gets a byte value from the datareader. | |
| virtual byte | GetByte (int i) |
| Gets a byte value from the datareader. | |
| Int64 | GetBytes (string name, Int64 fieldOffset, byte[] buffer, int bufferOffset, int length) |
| Invokes the GetBytes method of the underlying datareader. | |
| virtual Int64 | GetBytes (int i, Int64 fieldOffset, byte[]? buffer, int bufferOffset, int length) |
| Invokes the GetBytes method of the underlying datareader. | |
| char | GetChar (string name) |
| Gets a char value from the datareader. | |
| virtual char | GetChar (int i) |
| Gets a char value from the datareader. | |
| Int64 | GetChars (string name, Int64 fieldOffset, char[] buffer, int bufferOffset, int length) |
| Invokes the GetChars method of the underlying datareader. | |
| virtual Int64 | GetChars (int i, Int64 fieldOffset, char[]? buffer, int bufferOffset, int length) |
| Invokes the GetChars method of the underlying datareader. | |
| IDataReader | GetData (string name) |
| Invokes the GetData method of the underlying datareader. | |
| virtual IDataReader | GetData (int i) |
| Invokes the GetData method of the underlying datareader. | |
| string | GetDataTypeName (string name) |
| Invokes the GetDataTypeName method of the underlying datareader. | |
| virtual string | GetDataTypeName (int i) |
| Invokes the GetDataTypeName method of the underlying datareader. | |
| virtual DateTime | GetDateTime (string name) |
| Gets a date value from the datareader. | |
| virtual DateTime | GetDateTime (int i) |
| Gets a date value from the datareader. | |
| virtual DateTimeOffset | GetDateTimeOffset (string name) |
| Gets an UTC date value from the datareader. | |
| virtual DateTimeOffset | GetDateTimeOffset (int i) |
| Gets an UTC date value from the datareader. | |
| decimal | GetDecimal (string name) |
| Gets a decimal value from the datareader. | |
| virtual decimal | GetDecimal (int i) |
| Gets a decimal value from the datareader. | |
| Type | GetFieldType (string name) |
| Invokes the GetFieldType method of the underlying datareader. | |
| virtual Type | GetFieldType (int i) |
| Invokes the GetFieldType method of the underlying datareader. | |
| float | GetFloat (string name) |
| Gets a Single value from the datareader. | |
| virtual float | GetFloat (int i) |
| Gets a Single value from the datareader. | |
| short | GetInt16 (string name) |
| Gets a Short value from the datareader. | |
| virtual short | GetInt16 (int i) |
| Gets a Short value from the datareader. | |
| Int64 | GetInt64 (string name) |
| Gets a Long value from the datareader. | |
| virtual Int64 | GetInt64 (int i) |
| Gets a Long value from the datareader. | |
| virtual string | GetName (int i) |
| Invokes the GetName method of the underlying datareader. | |
| int | GetOrdinal (string name) |
| Gets an ordinal value from the datareader. | |
| DataTable? | GetSchemaTable () |
| Invokes the GetSchemaTable method of the underlying datareader. | |
| int | GetValues (object[] values) |
| Invokes the GetValues method of the underlying datareader. | |
| virtual bool | IsDBNull (int i) |
| Invokes the IsDBNull method of the underlying datareader. | |
| virtual bool | IsDBNull (string name) |
| Invokes the IsDBNull method of the underlying datareader. | |
| void | Dispose () |
| Disposes the object. | |
Protected Member Functions | |
| virtual void | Dispose (bool disposing) |
| Disposes the object. | |
Properties | |
| IDataReader | DataReader [get] |
| Get a reference to the underlying data reader object that actually contains the data from the data source. | |
| int | Depth [get] |
| Returns the depth property value from the datareader. | |
| int | FieldCount [get] |
| Returns the FieldCount property from the datareader. | |
| bool | IsClosed [get] |
| Returns the IsClosed property value from the datareader. | |
| object? | this[string name] [get] |
| Returns a value from the datareader. | |
| virtual ? object | this[int i] [get] |
| Returns a value from the datareader. | |
| int | RecordsAffected [get] |
| Returns the RecordsAffected property value from the underlying datareader. | |
This is an IDataReader that 'fixes' any null values before they are returned to our business code.
|
inline |
Initializes the SafeDataReader object to use data from the provided DataReader object.
| dataReader | The source DataReader object containing the data. |
| ArgumentNullException | dataReader is null. |
|
inline |
Closes the datareader.
|
inline |
Disposes the object.
|
inlineprotectedvirtual |
Disposes the object.
| disposing | True if called by the public Dispose method. |
|
inlinevirtual |
Gets a boolean value from the datareader.
Returns false for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a boolean value from the datareader.
Returns false for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a byte value from the datareader.
Returns 0 for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a byte value from the datareader.
Returns 0 for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Invokes the GetBytes method of the underlying datareader.
Returns 0 for null.
| i | Ordinal column position of the value. |
| buffer | Array containing the data. |
| bufferOffset | Offset position within the buffer. |
| fieldOffset | Offset position within the field. |
| length | Length of data to read. |
|
inline |
Invokes the GetBytes method of the underlying datareader.
Returns 0 for null.
| name | Name of the column containing the value. |
| buffer | Array containing the data. |
| bufferOffset | Offset position within the buffer. |
| fieldOffset | Offset position within the field. |
| length | Length of data to read. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a char value from the datareader.
Returns Char.MinValue for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a char value from the datareader.
Returns Char.MinValue for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Invokes the GetChars method of the underlying datareader.
Returns 0 for null.
| i | Ordinal column position of the value. |
| buffer | Array containing the data. |
| bufferOffset | Offset position within the buffer. |
| fieldOffset | Offset position within the field. |
| length | Length of data to read. |
|
inline |
Invokes the GetChars method of the underlying datareader.
Returns 0 for null.
| name | Name of the column containing the value. |
| buffer | Array containing the data. |
| bufferOffset | Offset position within the buffer. |
| fieldOffset | Offset position within the field. |
| length | Length of data to read. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Invokes the GetData method of the underlying datareader.
| i | Ordinal column position of the value. |
|
inline |
Invokes the GetData method of the underlying datareader.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Invokes the GetDataTypeName method of the underlying datareader.
| i | Ordinal column position of the value. |
|
inline |
Invokes the GetDataTypeName method of the underlying datareader.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a date value from the datareader.
Returns DateTime.MinValue for null.
| i | Ordinal column position of the value. |
|
inlinevirtual |
Gets a date value from the datareader.
Returns DateTime.MinValue for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets an UTC date value from the datareader.
Returns DateTimeOffset.MinValue for null.
| i | Ordinal column position of the value. |
|
inlinevirtual |
Gets an UTC date value from the datareader.
Returns DateTimeOffset.MinValue for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a decimal value from the datareader.
Returns 0 for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a decimal value from the datareader.
Returns 0 for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a double from the datareader.
Returns 0 for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a double from the datareader.
Returns 0 for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Invokes the GetFieldType method of the underlying datareader.
| i | Ordinal column position of the value. |
|
inline |
Invokes the GetFieldType method of the underlying datareader.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a Single value from the datareader.
Returns 0 for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a Single value from the datareader.
Returns 0 for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a Guid value from the datareader.
Returns Guid.Empty for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a Guid value from the datareader.
Returns Guid.Empty for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a Short value from the datareader.
Returns 0 for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a Short value from the datareader.
Returns 0 for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets an integer from the datareader.
Returns 0 for null.
| i | Ordinal column position of the value. |
|
inline |
Gets an integer from the datareader.
Returns 0 for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a Long value from the datareader.
Returns 0 for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a Long value from the datareader.
Returns 0 for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Invokes the GetName method of the underlying datareader.
| i | Ordinal column position of the value. |
|
inline |
Gets an ordinal value from the datareader.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inline |
Invokes the GetSchemaTable method of the underlying datareader.
|
inlinevirtual |
|
inlinevirtual |
Gets a SmartDate from the datareader.
| i | Ordinal column position of the value. |
| minIsEmpty | A flag indicating whether the min or max value of a data means an empty date. |
|
inline |
|
inline |
Gets a SmartDate from the datareader.
A null is converted into either the min or max possible date depending on the MinIsEmpty parameter. See Chapter 5 for more details on the SmartDate class.
| name | Name of the column containing the value. |
| minIsEmpty | A flag indicating whether the min or max value of a data means an empty date. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a string value from the datareader.
Returns empty string for null.
| i | Ordinal column position of the value. |
|
inline |
Gets a string value from the datareader.
Returns empty string for null.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inlinevirtual |
Gets a value of type System.Object from the datareader.
| i | Ordinal column position of the value. |
|
inline |
Gets a value of type System.Object from the datareader.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inline |
Invokes the GetValues method of the underlying datareader.
| values | An array of System.Object to copy the values into. |
|
inlinevirtual |
Invokes the IsDBNull method of the underlying datareader.
| i | Ordinal column position of the value. |
|
inlinevirtual |
Invokes the IsDBNull method of the underlying datareader.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |
|
inline |
Moves to the next result set in the datareader.
|
inline |
Reads the next row of data from the datareader.
|
getprotected |
Get a reference to the underlying data reader object that actually contains the data from the data source.
|
get |
Returns the depth property value from the datareader.
|
get |
Returns the FieldCount property from the datareader.
|
get |
Returns the IsClosed property value from the datareader.
|
get |
Returns the RecordsAffected property value from the underlying datareader.
|
get |
Returns a value from the datareader.
| i | Ordinal column position of the value. |
|
get |
Returns a value from the datareader.
| name | Name of the column containing the value. |
| ArgumentException | name is null, string.Empty or only consists of white spaces. |