Candor.Data.DataRecordExtensions.GetBoolean C# (CSharp) Method

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
        public static bool GetBoolean(this IDataRecord record, string name, bool defaultValue, bool ignoreErrors)
        {
            int index = FieldIndex(record, name);
            if (index < 0)
            {
                if (ignoreErrors)
                    return defaultValue;
                else
                    throw new ArgumentOutOfRangeException("name", name, "Field name does not exist.");
            }
            return GetBoolean(record[index], defaultValue);
        }

Same methods

DataRecordExtensions::GetBoolean ( object fieldValue, bool defaultValue ) : bool
DataRecordExtensions::GetBoolean ( this record, string name, bool defaultValue ) : bool