C# Class Candor.Data.DataRecordExtensions

Methods to get a data record row value cast to the desired type.
Show file Open project: michael-lang/candor-common

Public Methods

Method Description
FieldIndex ( this record, string name ) : int

Gets the index of a field of a specific name in a record.

GetBoolean ( object fieldValue, bool defaultValue ) : bool

Gets a value from a database field value or output parameter.

GetBoolean ( this record, string name, bool defaultValue ) : bool

Gets a field value from a record.

GetBoolean ( this record, string name, bool defaultValue, bool ignoreErrors ) : bool

Gets a field value from a record.

GetDateTime ( object fieldValue ) : System.DateTime

Gets a value from a database field value or output parameter.

GetDateTime ( object fieldValue, System.DateTime defaultValue ) : System.DateTime

Gets a value from a database field value or output parameter.

GetDateTime ( this record, string name ) : System.DateTime

Gets a field value from a record.

GetDateTime ( this record, string name, System.DateTime defaultValue ) : System.DateTime

Gets a field value from a record.

GetDateTime ( this record, string name, System.DateTime defaultValue, bool ignoreErrors ) : System.DateTime

Gets a field value from a record.

GetDecimal ( object fieldValue ) : decimal

Gets a value from a database field value or output parameter.

GetDecimal ( object fieldValue, decimal defaultValue ) : decimal

Gets a value from a database field value or output parameter.

GetDecimal ( this record, string name ) : decimal

Gets a field value from a record.

GetDecimal ( this record, string name, decimal defaultValue ) : decimal

Gets a field value from a record.

GetDecimal ( this record, string name, decimal defaultValue, bool ignoreErrors ) : decimal

Gets a field value from a record.

GetDouble ( object fieldValue ) : double

Gets a value from a database field value or output parameter.

GetDouble ( object fieldValue, double defaultValue ) : double

Gets a value from a database field value or output parameter.

GetDouble ( this record, string name ) : double

Gets a field value from a record.

GetDouble ( this record, string name, double defaultValue ) : double

Gets a field value from a record.

GetDouble ( this record, string name, double defaultValue, bool ignoreErrors ) : double

Gets a field value from a record.

GetGuid ( object fieldValue ) : System.Guid

Gets a value from a database field value or output parameter.

GetGuid ( object fieldValue, System.Guid defaultValue ) : System.Guid

Gets a value from a database field value or output parameter.

GetGuid ( this record, string name ) : System.Guid

Gets a field value from a record.

GetGuid ( this record, string name, System.Guid defaultValue ) : System.Guid

Gets a field value from a record.

GetGuid ( this record, string name, System.Guid defaultValue, bool ignoreErrors ) : System.Guid

Gets a field value from a record.

GetInt16 ( object fieldValue ) : short

Gets a value from a database field value or output parameter.

GetInt16 ( object fieldValue, short defaultValue ) : short

Gets a value from a database field value or output parameter.

GetInt16 ( this record, string name ) : short

Gets a field value from a record.

GetInt16 ( this record, string name, short defaultValue ) : short

Gets a field value from a record.

GetInt16 ( this record, string name, short defaultValue, bool ignoreErrors ) : short

Gets a field value from a record.

GetInt32 ( object fieldValue ) : int

Gets a value from a database field value or output parameter.

GetInt32 ( object fieldValue, int defaultValue ) : int

Gets a value from a database field value or output parameter.

GetInt32 ( this record, string name ) : int

Gets a field value from a record.

GetInt32 ( this record, string name, int defaultValue ) : int

Gets a field value from a record.

GetInt32 ( this record, string name, int defaultValue, bool ignoreErrors ) : int

Gets a field value from a record.

GetInt64 ( object fieldValue ) : long

Gets a value from a database field value or output parameter.

GetInt64 ( object fieldValue, long defaultValue ) : long

Gets a value from a database field value or output parameter.

GetInt64 ( this record, string name ) : long

Gets a field value from a record.

GetInt64 ( this record, string name, long defaultValue ) : long

Gets a field value from a record.

GetInt64 ( this record, string name, long defaultValue, bool ignoreErrors ) : long

Gets a field value from a record.

GetString ( object fieldValue ) : string

Gets a value from a database field value or output parameter.

GetString ( object fieldValue, string defaultValue ) : string

Gets a value from a database field value or output parameter.

GetString ( this record, string name ) : string

Gets a field value from a record.

GetString ( this record, string name, string defaultValue ) : string

Gets a field value from a record.

GetString ( this record, string name, string defaultValue, bool ignoreErrors ) : string

Gets a field value from a record.

GetUTCDateTime ( object fieldValue ) : System.DateTime

Gets a value from a database field value or output parameter.

GetUTCDateTime ( object fieldValue, System.DateTime defaultValue ) : System.DateTime

Gets a value from a database field value or output parameter.

GetUTCDateTime ( this record, string name ) : System.DateTime

Gets a field value from a record.

GetUTCDateTime ( this record, string name, System.DateTime defaultValue ) : System.DateTime

Gets a field value from a record.

GetUTCDateTime ( this record, string name, System.DateTime defaultValue, bool ignoreErrors ) : System.DateTime

Gets a field value from a record.

GetValue ( object fieldValue ) : object

Gets a value from a database field value or output parameter.

GetValue ( object fieldValue, object defaultValue ) : object

Gets a value from a database field value or output parameter.

GetValue ( this record, string name ) : object

Gets a field value from a record.

GetValue ( this record, string name, bool ignoreErrors ) : object

Gets a field value from a record.

Method Details

FieldIndex() public static method

Gets the index of a field of a specific name in a record.
public static FieldIndex ( this record, string name ) : int
record this The source record.
name string The field name to find.
return int

GetBoolean() public static method

Gets a value from a database field value or output parameter.
public static GetBoolean ( object fieldValue, bool defaultValue ) : bool
fieldValue object The value to convert.
defaultValue bool The default value if the original is DbNull.
return bool

GetBoolean() public static method

Gets a field value from a record.
public static GetBoolean ( this record, string name, bool defaultValue ) : bool
record this The source record.
name string The field name to find.
defaultValue bool The default in case the value is not assigned.
return bool

GetBoolean() public static method

Gets a field value from a record.
public static GetBoolean ( this record, string name, bool defaultValue, bool ignoreErrors ) : bool
record this The source record.
name string The field name to find.
defaultValue bool The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return bool

GetDateTime() public static method

Gets a value from a database field value or output parameter.
public static GetDateTime ( object fieldValue ) : System.DateTime
fieldValue object The value to convert.
return System.DateTime

GetDateTime() public static method

Gets a value from a database field value or output parameter.
public static GetDateTime ( object fieldValue, System.DateTime defaultValue ) : System.DateTime
fieldValue object The value to convert.
defaultValue System.DateTime The default value if the original is DbNull.
return System.DateTime

GetDateTime() public static method

Gets a field value from a record.
public static GetDateTime ( this record, string name ) : System.DateTime
record this The source record.
name string The field name to find.
return System.DateTime

GetDateTime() public static method

Gets a field value from a record.
public static GetDateTime ( this record, string name, System.DateTime defaultValue ) : System.DateTime
record this The source record.
name string The field name to find.
defaultValue System.DateTime The default in case the value is not assigned.
return System.DateTime

GetDateTime() public static method

Gets a field value from a record.
public static GetDateTime ( this record, string name, System.DateTime defaultValue, bool ignoreErrors ) : System.DateTime
record this The source record.
name string The field name to find.
defaultValue System.DateTime The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return System.DateTime

GetDecimal() public static method

Gets a value from a database field value or output parameter.
public static GetDecimal ( object fieldValue ) : decimal
fieldValue object The value to convert.
return decimal

GetDecimal() public static method

Gets a value from a database field value or output parameter.
public static GetDecimal ( object fieldValue, decimal defaultValue ) : decimal
fieldValue object The value to convert.
defaultValue decimal The default value if the original is DbNull.
return decimal

GetDecimal() public static method

Gets a field value from a record.
public static GetDecimal ( this record, string name ) : decimal
record this The source record.
name string The field name to find.
return decimal

GetDecimal() public static method

Gets a field value from a record.
public static GetDecimal ( this record, string name, decimal defaultValue ) : decimal
record this The source record.
name string The field name to find.
defaultValue decimal The default in case the value is not assigned.
return decimal

GetDecimal() public static method

Gets a field value from a record.
public static GetDecimal ( this record, string name, decimal defaultValue, bool ignoreErrors ) : decimal
record this The source record.
name string The field name to find.
defaultValue decimal The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return decimal

GetDouble() public static method

Gets a value from a database field value or output parameter.
public static GetDouble ( object fieldValue ) : double
fieldValue object The value to convert.
return double

GetDouble() public static method

Gets a value from a database field value or output parameter.
public static GetDouble ( object fieldValue, double defaultValue ) : double
fieldValue object The value to convert.
defaultValue double The default value if the original is DbNull.
return double

GetDouble() public static method

Gets a field value from a record.
public static GetDouble ( this record, string name ) : double
record this The source record.
name string The field name to find.
return double

GetDouble() public static method

Gets a field value from a record.
public static GetDouble ( this record, string name, double defaultValue ) : double
record this The source record.
name string The field name to find.
defaultValue double The default in case the value is not assigned.
return double

GetDouble() public static method

Gets a field value from a record.
public static GetDouble ( this record, string name, double defaultValue, bool ignoreErrors ) : double
record this The source record.
name string The field name to find.
defaultValue double The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return double

GetGuid() public static method

Gets a value from a database field value or output parameter.
public static GetGuid ( object fieldValue ) : System.Guid
fieldValue object The value to convert.
return System.Guid

GetGuid() public static method

Gets a value from a database field value or output parameter.
public static GetGuid ( object fieldValue, System.Guid defaultValue ) : System.Guid
fieldValue object The value to convert.
defaultValue System.Guid The default value if the original is DbNull.
return System.Guid

GetGuid() public static method

Gets a field value from a record.
public static GetGuid ( this record, string name ) : System.Guid
record this The source record.
name string The field name to find.
return System.Guid

GetGuid() public static method

Gets a field value from a record.
public static GetGuid ( this record, string name, System.Guid defaultValue ) : System.Guid
record this The source record.
name string The field name to find.
defaultValue System.Guid The default in case the value is not assigned.
return System.Guid

GetGuid() public static method

Gets a field value from a record.
public static GetGuid ( this record, string name, System.Guid defaultValue, bool ignoreErrors ) : System.Guid
record this The source record.
name string The field name to find.
defaultValue System.Guid The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return System.Guid

GetInt16() public static method

Gets a value from a database field value or output parameter.
public static GetInt16 ( object fieldValue ) : short
fieldValue object The value to convert.
return short

GetInt16() public static method

Gets a value from a database field value or output parameter.
public static GetInt16 ( object fieldValue, short defaultValue ) : short
fieldValue object The value to convert.
defaultValue short The default value if the original is DbNull.
return short

GetInt16() public static method

Gets a field value from a record.
public static GetInt16 ( this record, string name ) : short
record this The source record.
name string The field name to find.
return short

GetInt16() public static method

Gets a field value from a record.
public static GetInt16 ( this record, string name, short defaultValue ) : short
record this The source record.
name string The field name to find.
defaultValue short The default in case the value is not assigned.
return short

GetInt16() public static method

Gets a field value from a record.
public static GetInt16 ( this record, string name, short defaultValue, bool ignoreErrors ) : short
record this The source record.
name string The field name to find.
defaultValue short The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return short

GetInt32() public static method

Gets a value from a database field value or output parameter.
public static GetInt32 ( object fieldValue ) : int
fieldValue object The value to convert.
return int

GetInt32() public static method

Gets a value from a database field value or output parameter.
public static GetInt32 ( object fieldValue, int defaultValue ) : int
fieldValue object The value to convert.
defaultValue int The default value if the original is DbNull.
return int

GetInt32() public static method

Gets a field value from a record.
public static GetInt32 ( this record, string name ) : int
record this The source record.
name string The field name to find.
return int

GetInt32() public static method

Gets a field value from a record.
public static GetInt32 ( this record, string name, int defaultValue ) : int
record this The source record.
name string The field name to find.
defaultValue int The default in case the value is not assigned.
return int

GetInt32() public static method

Gets a field value from a record.
public static GetInt32 ( this record, string name, int defaultValue, bool ignoreErrors ) : int
record this The source record.
name string The field name to find.
defaultValue int The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return int

GetInt64() public static method

Gets a value from a database field value or output parameter.
public static GetInt64 ( object fieldValue ) : long
fieldValue object The value to convert.
return long

GetInt64() public static method

Gets a value from a database field value or output parameter.
public static GetInt64 ( object fieldValue, long defaultValue ) : long
fieldValue object The value to convert.
defaultValue long The default value if the original is DbNull.
return long

GetInt64() public static method

Gets a field value from a record.
public static GetInt64 ( this record, string name ) : long
record this The source record.
name string The field name to find.
return long

GetInt64() public static method

Gets a field value from a record.
public static GetInt64 ( this record, string name, long defaultValue ) : long
record this The source record.
name string The field name to find.
defaultValue long The default in case the value is not assigned.
return long

GetInt64() public static method

Gets a field value from a record.
public static GetInt64 ( this record, string name, long defaultValue, bool ignoreErrors ) : long
record this The source record.
name string The field name to find.
defaultValue long The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return long

GetString() public static method

Gets a value from a database field value or output parameter.
public static GetString ( object fieldValue ) : string
fieldValue object The value to convert.
return string

GetString() public static method

Gets a value from a database field value or output parameter.
public static GetString ( object fieldValue, string defaultValue ) : string
fieldValue object The value to convert.
defaultValue string The default value if the original is DbNull.
return string

GetString() public static method

Gets a field value from a record.
public static GetString ( this record, string name ) : string
record this The source record.
name string The field name to find.
return string

GetString() public static method

Gets a field value from a record.
public static GetString ( this record, string name, string defaultValue ) : string
record this The source record.
name string The field name to find.
defaultValue string The default in case the value is not assigned.
return string

GetString() public static method

Gets a field value from a record.
public static GetString ( this record, string name, string defaultValue, bool ignoreErrors ) : string
record this The source record.
name string The field name to find.
defaultValue string The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return string

GetUTCDateTime() public static method

Gets a value from a database field value or output parameter.
public static GetUTCDateTime ( object fieldValue ) : System.DateTime
fieldValue object The value to convert.
return System.DateTime

GetUTCDateTime() public static method

Gets a value from a database field value or output parameter.
public static GetUTCDateTime ( object fieldValue, System.DateTime defaultValue ) : System.DateTime
fieldValue object The value to convert.
defaultValue System.DateTime The default value if the original is DbNull.
return System.DateTime

GetUTCDateTime() public static method

Gets a field value from a record.
public static GetUTCDateTime ( this record, string name ) : System.DateTime
record this The source record.
name string The field name to find.
return System.DateTime

GetUTCDateTime() public static method

Gets a field value from a record.
public static GetUTCDateTime ( this record, string name, System.DateTime defaultValue ) : System.DateTime
record this The source record.
name string The field name to find.
defaultValue System.DateTime The default in case the value is not assigned.
return System.DateTime

GetUTCDateTime() public static method

Gets a field value from a record.
public static GetUTCDateTime ( this record, string name, System.DateTime defaultValue, bool ignoreErrors ) : System.DateTime
record this The source record.
name string The field name to find.
defaultValue System.DateTime The default in case the value is not assigned.
ignoreErrors bool Specifies if a missing field should return the default value.
return System.DateTime

GetValue() public static method

Gets a value from a database field value or output parameter.
public static GetValue ( object fieldValue ) : object
fieldValue object The value to convert.
return object

GetValue() public static method

Gets a value from a database field value or output parameter.
public static GetValue ( object fieldValue, object defaultValue ) : object
fieldValue object The value to convert.
defaultValue object The default value if the original is DbNull.
return object

GetValue() public static method

Gets a field value from a record.
public static GetValue ( this record, string name ) : object
record this The source record.
name string The field name to find.
return object

GetValue() public static method

Gets a field value from a record.
public static GetValue ( this record, string name, bool ignoreErrors ) : object
record this The source record.
name string The field name to find.
ignoreErrors bool Specifies if a missing field should return the default value.
return object