/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Int64}"/> /// </summary> /// <param name="record">The data record</param> /// <param name="name">The name of the column</param> /// <returns>The value in the given column converted to <see cref="Nullable{Int64}"/> </returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Int64"/> if possible. /// </remarks> public static long?GetNullableInt64(this IDbDataRecord record, string name) { if (record.IsDBNull(name)) { return(null); } return(record.GetInt64(name)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Single}"/> /// </summary> /// <param name="record">The data record</param> /// <param name="name">The name of the column</param> /// <returns>The value in the given column converted to <see cref="Nullable{Single}"/> </returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Single"/> if possible. /// </remarks> public static float?GetNullableFloat(this IDbDataRecord record, string name) { if (record.IsDBNull(name)) { return(null); } return(record.GetFloat(name)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Guid}"/> /// </summary> /// <param name="record">The data record</param> /// <param name="name">The name of the column</param> /// <returns>The value in the given column converted to <see cref="Nullable{Guid}"/> </returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Guid"/> if possible. /// </remarks> public static Guid?GetNullableGuid(this IDbDataRecord record, string name) { if (record.IsDBNull(name)) { return(null); } return(record.GetGuid(name)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Decimal}"/> /// </summary> /// <param name="record">The data record</param> /// <param name="name">The name of the column</param> /// <returns>The value in the given column converted to <see cref="Nullable{Decimal}"/> </returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Decimal"/> if possible. /// </remarks> public static decimal?GetNullableDecimal(this IDbDataRecord record, string name) { if (record.IsDBNull(name)) { return(null); } return(record.GetDecimal(name)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Double}"/> /// </summary> /// <param name="record">The data record</param> /// <param name="name">The name of the column</param> /// <returns>The value in the given column converted to <see cref="Nullable{Double}"/> </returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Double"/> if possible. /// </remarks> public static double?GetNullableDouble(this IDbDataRecord record, string name) { if (record.IsDBNull(name)) { return(null); } return(record.GetDouble(name)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Boolean}"/>. /// </summary> /// <param name="record">The data record.</param> /// <param name="name">The name of the column.</param> /// <returns>The value in the given column converted to <see cref="Nullable{Boolean}"/>.</returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Boolean"/> if possible. /// </remarks> public static bool?GetNullableBoolean(this IDbDataRecord record, string name) { if (record.IsDBNull(name)) { return(null); } return(record.GetBoolean(name)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Char}"/> /// </summary> /// <param name="record">The data record</param> /// <param name="name">The name of the column</param> /// <returns>The value in the given column converted to <see cref="Nullable{Char}"/> </returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Char"/> if possible. /// </remarks> public static char?GetNullableChar(this IDbDataRecord record, string name) { if (record.IsDBNull(name)) { return(null); } return(record.GetChar(name)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Guid}"/>. /// </summary> /// <param name="record">The data record.</param> /// <param name="index">The zero-based column ordinal.</param> /// <returns>The value in the given column converted to <see cref="Nullable{Guid}"/>.</returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Guid"/> if possible. /// </remarks> public static Guid?GetNullableGuid(this IDbDataRecord record, int index) { if (record.IsDBNull(index)) { return(null); } return(record.GetGuid(index)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Int64}"/>. /// </summary> /// <param name="record">The data record.</param> /// <param name="index">The zero-based column ordinal.</param> /// <returns>The value in the given column converted to <see cref="Nullable{Int64}"/>.</returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Int64"/> if possible. /// </remarks> public static long?GetNullableInt64(this IDbDataRecord record, int index) { if (record.IsDBNull(index)) { return(null); } return(record.GetInt64(index)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Single}"/>. /// </summary> /// <param name="record">The data record.</param> /// <param name="index">The zero-based column ordinal.</param> /// <returns>The value in the given column converted to <see cref="Nullable{Single}"/>.</returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Single"/> if possible. /// </remarks> public static float?GetNullableFloat(this IDbDataRecord record, int index) { if (record.IsDBNull(index)) { return(null); } return(record.GetFloat(index)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Double}"/>. /// </summary> /// <param name="record">The data record.</param> /// <param name="index">The zero-based column ordinal.</param> /// <returns>The value in the given column converted to <see cref="Nullable{Double}"/>.</returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Double"/> if possible. /// </remarks> public static double?GetNullableDouble(this IDbDataRecord record, int index) { if (record.IsDBNull(index)) { return(null); } return(record.GetDouble(index)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Decimal}"/>. /// </summary> /// <param name="record">The data record.</param> /// <param name="index">The zero-based column ordinal.</param> /// <returns>The value in the given column converted to <see cref="Nullable{Decimal}"/>.</returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Decimal"/> if possible. /// </remarks> public static decimal?GetNullableDecimal(this IDbDataRecord record, int index) { if (record.IsDBNull(index)) { return(null); } return(record.GetDecimal(index)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Char}"/>. /// </summary> /// <param name="record">The data record.</param> /// <param name="index">The zero-based column ordinal.</param> /// <returns>The value in the given column converted to <see cref="Nullable{Char}"/>.</returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Char"/> if possible. /// </remarks> public static char?GetNullableChar(this IDbDataRecord record, int index) { if (record.IsDBNull(index)) { return(null); } return(record.GetChar(index)); }
/// <summary> /// Returns the value in the given column converted to <see cref="Nullable{Boolean}"/>. /// </summary> /// <param name="record">The data record.</param> /// <param name="index">The zero-based column ordinal.</param> /// <returns>The value in the given column converted to <see cref="Nullable{Boolean}"/>.</returns> /// <remarks> /// If the value in the column is <see cref="DBNull"/>, <c>null</c> is returned. Otherwise the value is /// converted to a <see cref="Boolean"/> if possible. /// </remarks> public static bool?GetNullableBoolean(this IDbDataRecord record, int index) { if (record.IsDBNull(index)) { return(null); } return(record.GetBoolean(index)); }