C# Class EventCentric.Database.DataReaderExtensions

Provides usability overloads for SqlDataReader.
Based on: http://stackoverflow.com/questions/1772025/sql-data-reader-handling-null-column-values
Mostra file Open project: Narvalex/EventCentric

Public Methods

Method Description
GetBoolean ( this reader, string name ) : bool
GetDateTime ( this reader, string name ) : System.DateTime
GetDecimal ( this reader, string name ) : decimal
GetDouble ( this reader, string name ) : double
GetFloat ( this reader, string name ) : float
GetGuid ( this reader, string name ) : System.Guid
GetInt32 ( this reader, string name ) : int
GetInt64 ( this reader, string name ) : long
GetString ( this reader, string name ) : string
GetValue ( this reader, string column ) : object
SafeGetBoolean ( this reader, int i ) : bool
SafeGetBoolean ( this reader, string name ) : bool
SafeGetBooleanOrNull ( this reader, int i ) : bool?
SafeGetBooleanOrNull ( this reader, string name ) : bool?
SafeGetDateTime ( this reader, int i ) : System.DateTime
SafeGetDateTime ( this reader, string name ) : System.DateTime
SafeGetDateTimeOrNull ( this reader, int i ) : DateTime?
SafeGetDateTimeOrNull ( this reader, string name ) : DateTime?
SafeGetDecimal ( this reader, int i ) : decimal
SafeGetDecimal ( this reader, string name ) : decimal
SafeGetDecimalOrNull ( this reader, int i ) : decimal?
SafeGetDecimalOrNull ( this reader, string name ) : decimal?
SafeGetDouble ( this reader, int i ) : double
SafeGetDouble ( this reader, string name ) : double
SafeGetDoubleOrNull ( this reader, int i ) : double?
SafeGetDoubleOrNull ( this reader, string name ) : double?
SafeGetFloat ( this reader, int i ) : float
SafeGetFloat ( this reader, string name ) : float
SafeGetFloatOrNull ( this reader, int i ) : float?
SafeGetFloatOrNull ( this reader, string name ) : float?
SafeGetGuid ( this reader, int i ) : System.Guid
SafeGetGuid ( this reader, string name ) : System.Guid
SafeGetGuidOrNull ( this reader, int i ) : Guid?
SafeGetGuidOrNull ( this reader, string name ) : Guid?
SafeGetInt32 ( this reader, int i ) : int
SafeGetInt32 ( this reader, string name ) : int
SafeGetInt32OrNull ( this reader, int i ) : int?
SafeGetInt32OrNull ( this reader, string name ) : int?
SafeGetInt64 ( this reader, int i ) : long
SafeGetInt64 ( this reader, string name ) : long
SafeGetInt64OrNull ( this reader, int i ) : long?
SafeGetInt64OrNull ( this reader, string name ) : long?
SafeGetString ( this reader, int i ) : string
SafeGetString ( this reader, string name ) : string
SafeGetStringAndTrim ( this reader, int i ) : string
SafeGetStringAndTrim ( this reader, string name ) : string
SafeGetValue ( this reader, int i ) : object
SafeGetValue ( this reader, string column ) : object

Method Details

GetBoolean() public static method

public static GetBoolean ( this reader, string name ) : bool
reader this
name string
return bool

GetDateTime() public static method

public static GetDateTime ( this reader, string name ) : System.DateTime
reader this
name string
return System.DateTime

GetDecimal() public static method

public static GetDecimal ( this reader, string name ) : decimal
reader this
name string
return decimal

GetDouble() public static method

public static GetDouble ( this reader, string name ) : double
reader this
name string
return double

GetFloat() public static method

public static GetFloat ( this reader, string name ) : float
reader this
name string
return float

GetGuid() public static method

public static GetGuid ( this reader, string name ) : System.Guid
reader this
name string
return System.Guid

GetInt32() public static method

public static GetInt32 ( this reader, string name ) : int
reader this
name string
return int

GetInt64() public static method

public static GetInt64 ( this reader, string name ) : long
reader this
name string
return long

GetString() public static method

public static GetString ( this reader, string name ) : string
reader this
name string
return string

GetValue() public static method

public static GetValue ( this reader, string column ) : object
reader this
column string
return object

SafeGetBoolean() public static method

public static SafeGetBoolean ( this reader, int i ) : bool
reader this
i int
return bool

SafeGetBoolean() public static method

public static SafeGetBoolean ( this reader, string name ) : bool
reader this
name string
return bool

SafeGetBooleanOrNull() public static method

public static SafeGetBooleanOrNull ( this reader, int i ) : bool?
reader this
i int
return bool?

SafeGetBooleanOrNull() public static method

public static SafeGetBooleanOrNull ( this reader, string name ) : bool?
reader this
name string
return bool?

SafeGetDateTime() public static method

public static SafeGetDateTime ( this reader, int i ) : System.DateTime
reader this
i int
return System.DateTime

SafeGetDateTime() public static method

public static SafeGetDateTime ( this reader, string name ) : System.DateTime
reader this
name string
return System.DateTime

SafeGetDateTimeOrNull() public static method

public static SafeGetDateTimeOrNull ( this reader, int i ) : DateTime?
reader this
i int
return DateTime?

SafeGetDateTimeOrNull() public static method

public static SafeGetDateTimeOrNull ( this reader, string name ) : DateTime?
reader this
name string
return DateTime?

SafeGetDecimal() public static method

public static SafeGetDecimal ( this reader, int i ) : decimal
reader this
i int
return decimal

SafeGetDecimal() public static method

public static SafeGetDecimal ( this reader, string name ) : decimal
reader this
name string
return decimal

SafeGetDecimalOrNull() public static method

public static SafeGetDecimalOrNull ( this reader, int i ) : decimal?
reader this
i int
return decimal?

SafeGetDecimalOrNull() public static method

public static SafeGetDecimalOrNull ( this reader, string name ) : decimal?
reader this
name string
return decimal?

SafeGetDouble() public static method

public static SafeGetDouble ( this reader, int i ) : double
reader this
i int
return double

SafeGetDouble() public static method

public static SafeGetDouble ( this reader, string name ) : double
reader this
name string
return double

SafeGetDoubleOrNull() public static method

public static SafeGetDoubleOrNull ( this reader, int i ) : double?
reader this
i int
return double?

SafeGetDoubleOrNull() public static method

public static SafeGetDoubleOrNull ( this reader, string name ) : double?
reader this
name string
return double?

SafeGetFloat() public static method

public static SafeGetFloat ( this reader, int i ) : float
reader this
i int
return float

SafeGetFloat() public static method

public static SafeGetFloat ( this reader, string name ) : float
reader this
name string
return float

SafeGetFloatOrNull() public static method

public static SafeGetFloatOrNull ( this reader, int i ) : float?
reader this
i int
return float?

SafeGetFloatOrNull() public static method

public static SafeGetFloatOrNull ( this reader, string name ) : float?
reader this
name string
return float?

SafeGetGuid() public static method

public static SafeGetGuid ( this reader, int i ) : System.Guid
reader this
i int
return System.Guid

SafeGetGuid() public static method

public static SafeGetGuid ( this reader, string name ) : System.Guid
reader this
name string
return System.Guid

SafeGetGuidOrNull() public static method

public static SafeGetGuidOrNull ( this reader, int i ) : Guid?
reader this
i int
return Guid?

SafeGetGuidOrNull() public static method

public static SafeGetGuidOrNull ( this reader, string name ) : Guid?
reader this
name string
return Guid?

SafeGetInt32() public static method

public static SafeGetInt32 ( this reader, int i ) : int
reader this
i int
return int

SafeGetInt32() public static method

public static SafeGetInt32 ( this reader, string name ) : int
reader this
name string
return int

SafeGetInt32OrNull() public static method

public static SafeGetInt32OrNull ( this reader, int i ) : int?
reader this
i int
return int?

SafeGetInt32OrNull() public static method

public static SafeGetInt32OrNull ( this reader, string name ) : int?
reader this
name string
return int?

SafeGetInt64() public static method

public static SafeGetInt64 ( this reader, int i ) : long
reader this
i int
return long

SafeGetInt64() public static method

public static SafeGetInt64 ( this reader, string name ) : long
reader this
name string
return long

SafeGetInt64OrNull() public static method

public static SafeGetInt64OrNull ( this reader, int i ) : long?
reader this
i int
return long?

SafeGetInt64OrNull() public static method

public static SafeGetInt64OrNull ( this reader, string name ) : long?
reader this
name string
return long?

SafeGetString() public static method

public static SafeGetString ( this reader, int i ) : string
reader this
i int
return string

SafeGetString() public static method

public static SafeGetString ( this reader, string name ) : string
reader this
name string
return string

SafeGetStringAndTrim() public static method

public static SafeGetStringAndTrim ( this reader, int i ) : string
reader this
i int
return string

SafeGetStringAndTrim() public static method

public static SafeGetStringAndTrim ( this reader, string name ) : string
reader this
name string
return string

SafeGetValue() public static method

public static SafeGetValue ( this reader, int i ) : object
reader this
i int
return object

SafeGetValue() public static method

public static SafeGetValue ( this reader, string column ) : object
reader this
column string
return object