C# Class MicroLite.TypeConverters.TimeSpanTypeConverter

An ITypeConverter which can convert a TimeSpan to and from the stored database value of a 64 bit integer column.
Inheritance: ITypeConverter
Show file Open project: TrevorPilley/MicroLite Class Usage Examples

Public Methods

Method Description
CanConvert ( Type type ) : bool

Determines whether this type converter can convert values for the specified type.

ConvertFromDbValue ( IDataReader reader, int index, Type type ) : object

Converts value at the specified index in the IDataReader into an instance of the specified type.

ConvertFromDbValue ( object value, Type type ) : object

Converts the specified database value into an instance of the specified type.

ConvertToDbValue ( object value, Type type ) : object

Converts the specified value into an instance of the database value.

TimeSpanTypeConverter ( ) : System

Initialises a new instance of the TimeSpanTypeConverter class.

Method Details

CanConvert() public method

Determines whether this type converter can convert values for the specified type.
public CanConvert ( Type type ) : bool
type System.Type The type to check.
return bool

ConvertFromDbValue() public method

Converts value at the specified index in the IDataReader into an instance of the specified type.
public ConvertFromDbValue ( IDataReader reader, int index, Type type ) : object
reader IDataReader The IDataReader containing the results.
index int The index of the record to read from the IDataReader.
type System.Type The type to convert result value to.
return object

ConvertFromDbValue() public method

Converts the specified database value into an instance of the specified type.
public ConvertFromDbValue ( object value, Type type ) : object
value object The database value to be converted.
type System.Type The type to convert to.
return object

ConvertToDbValue() public method

Converts the specified value into an instance of the database value.
public ConvertToDbValue ( object value, Type type ) : object
value object The value to be converted.
type System.Type The type to convert from.
return object

TimeSpanTypeConverter() public method

Initialises a new instance of the TimeSpanTypeConverter class.
public TimeSpanTypeConverter ( ) : System
return System