C# Class Negri.Wot.Sql.DataUtils

Mostrar archivo Open project: negri/wotclans

Public Methods

Method Description
GetBytes ( IDataRecord reader, int index ) : byte[]

Gets the bytes.

GetDate ( IDataRecord dr, int index ) : DateTime

Retorna somente a DATA

GetDateTimeUtc ( IDataRecord reader, int index ) : DateTime

Gets the date time UTC.

GetNonNullValue ( IDataRecord dr, int index ) : T

Obtem um valor que NÃO pode estar nulo no BD.

A vantagem sobre IDateRecord.GetValue é que caso o campo esteja nulo no BD a exceção mostrara o ordinal do campo com problemas.

GetNullableDate ( IDataRecord dr, int index ) : DateTime?

Retorna somente a DATA (null caso seja nulo no BD)

GetNullableDateTimeUtc ( IDataRecord reader, int index ) : DateTime?

Gets the date time UTC.

GetNullableString ( IDataRecord dr, int index ) : string

Retorna uma string que pode estar nula no BD. Nesse caso retornara string.Empty

GetValueOrDefault ( IDataRecord dr, int index ) : T

Gets the value or default.

Normalize ( double d ) : double

Method Details

GetBytes() public static method

Gets the bytes.
public static GetBytes ( IDataRecord reader, int index ) : byte[]
reader IDataRecord The reader.
index int The field number.
return byte[]

GetDate() public static method

Retorna somente a DATA
public static GetDate ( IDataRecord dr, int index ) : DateTime
dr IDataRecord
index int
return DateTime

GetDateTimeUtc() public static method

Gets the date time UTC.
public static GetDateTimeUtc ( IDataRecord reader, int index ) : DateTime
reader IDataRecord The reader.
index int The field number.
return DateTime

GetNonNullValue() public static method

Obtem um valor que NÃO pode estar nulo no BD.
A vantagem sobre IDateRecord.GetValue é que caso o campo esteja nulo no BD a exceção mostrara o ordinal do campo com problemas.
public static GetNonNullValue ( IDataRecord dr, int index ) : T
dr IDataRecord
index int
return T

GetNullableDate() public static method

Retorna somente a DATA (null caso seja nulo no BD)
public static GetNullableDate ( IDataRecord dr, int index ) : DateTime?
dr IDataRecord
index int
return DateTime?

GetNullableDateTimeUtc() public static method

Gets the date time UTC.
public static GetNullableDateTimeUtc ( IDataRecord reader, int index ) : DateTime?
reader IDataRecord The reader.
index int The field number.
return DateTime?

GetNullableString() public static method

Retorna uma string que pode estar nula no BD. Nesse caso retornara string.Empty
public static GetNullableString ( IDataRecord dr, int index ) : string
dr IDataRecord
index int
return string

GetValueOrDefault() public static method

Gets the value or default.
public static GetValueOrDefault ( IDataRecord dr, int index ) : T
dr IDataRecord The dr.
index int The index.
return T

Normalize() public static method

public static Normalize ( double d ) : double
d double
return double