Show / Hide Table of Contents

    Class DbParameterExtensions

    This class adds extension methods which simplify getting typed .NET values from (output) parameters. Because these methods reference the abstract DbParameterCollection, these methods are available in the derived classes:

    Inheritance
    System.Object
    DbParameterExtensions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: ArgentSea
    Assembly: ArgentSea.dll
    Syntax
    public static class DbParameterExtensions

    Methods

    | Improve this Doc View Source

    GetBoolean(DbParameter)

    Gets a Boolean value from the output parameter.

    Declaration
    public static bool GetBoolean(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Boolean

    The parameter value as a Boolean.

    Exceptions
    Type Condition
    ArgentSea.UnexpectedNullException

    Thrown when a database null value is encountered.

    | Improve this Doc View Source

    GetByte(DbParameter)

    Gets a byte value from the output parameter.

    Declaration
    public static byte GetByte(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Byte

    The parameter value as a byte array.

    Exceptions
    Type Condition
    ArgentSea.UnexpectedNullException

    Thrown when a database null value is encountered.

    | Improve this Doc View Source

    GetBytes(DbParameter)

    Gets a byte array from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static byte[] GetBytes(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Byte[]

    The parameter value as a byte[].

    | Improve this Doc View Source

    GetDateTime(DbParameter)

    Gets a DateTime value from the output parameter.

    Declaration
    public static DateTime GetDateTime(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.DateTime

    The parameter value as a DateTime.

    Exceptions
    Type Condition
    ArgentSea.UnexpectedNullException

    Thrown when a database null value is encountered.

    | Improve this Doc View Source

    GetDateTimeOffset(DbParameter)

    Gets a DateTimeOffset value from the output parameter.

    Declaration
    public static DateTimeOffset GetDateTimeOffset(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.DateTimeOffset

    The parameter value as a DateTimeOffset.

    Exceptions
    Type Condition
    ArgentSea.UnexpectedNullException

    Thrown when a database null value is encountered.

    | Improve this Doc View Source

    GetDecimal(DbParameter)

    Gets a Decimal value from the output parameter.

    Declaration
    public static decimal GetDecimal(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Decimal

    The parameter value as a Decimal.

    Exceptions
    Type Condition
    ArgentSea.UnexpectedNullException

    Thrown when a database null value is encountered.

    | Improve this Doc View Source

    GetDouble(DbParameter)

    Gets a Double (64-bit floating point) value from the output parameter, or NaN (Not a Number) if the value is DbNull.

    Declaration
    public static double GetDouble(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Double

    The parameter value as a Double.

    | Improve this Doc View Source

    GetFloat(DbParameter)

    Gets a Float (32-bit floating point) value from the output parameter, or NaN (Not a Number) if the value is DbNull.

    Declaration
    public static float GetFloat(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Single

    The parameter value as a Float.

    | Improve this Doc View Source

    GetGuid(DbParameter)

    Gets a Guid value from the output parameter, or Guid.Emtpy if the value is DbNull.

    Declaration
    public static Guid GetGuid(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Guid

    The parameter value as a Guid.

    | Improve this Doc View Source

    GetInteger(DbParameter)

    Gets an Int32 value from the output parameter.

    Declaration
    public static int GetInteger(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Int32

    The parameter value as an Int32.

    Exceptions
    Type Condition
    ArgentSea.UnexpectedNullException

    Thrown when a database null value is encountered.

    | Improve this Doc View Source

    GetLong(DbParameter)

    Gets an Int64 value from the output parameter.

    Declaration
    public static long GetLong(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Int64

    The parameter value as an Int64.

    Exceptions
    Type Condition
    ArgentSea.UnexpectedNullException

    Thrown when a database null value is encountered.

    | Improve this Doc View Source

    GetNullableBoolean(DbParameter)

    Gets a Nullable<Boolean> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static bool? GetNullableBoolean(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.Boolean>

    The parameter value as a Nullable<Boolean>.

    | Improve this Doc View Source

    GetNullableByte(DbParameter)

    Gets a Nullable<Byte> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static byte? GetNullableByte(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.Byte>

    The parameter value as a Nullable<Byte>.

    | Improve this Doc View Source

    GetNullableDateTime(DbParameter)

    Gets a Nullable<DateTime>) value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static DateTime? GetNullableDateTime(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.DateTime>

    The parameter value as a Nullable<DateTime>.

    | Improve this Doc View Source

    GetNullableDateTimeOffset(DbParameter)

    Gets a Nullable<DateTimeOffset> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static DateTimeOffset? GetNullableDateTimeOffset(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.DateTimeOffset>

    The parameter value as a Nullable<DateTimeOffset>.

    | Improve this Doc View Source

    GetNullableDecimal(DbParameter)

    Gets a Nullable<Decimal> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static decimal? GetNullableDecimal(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.Decimal>

    The parameter value as a Nullable<Decimal>.

    | Improve this Doc View Source

    GetNullableDouble(DbParameter)

    Gets a Nullable<Double> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static double? GetNullableDouble(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.Double>

    The parameter value as a Nullable<Double>.

    | Improve this Doc View Source

    GetNullableFloat(DbParameter)

    Gets a Nullable<Float> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static float? GetNullableFloat(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.Single>

    The parameter value as a Nullable<Float>.

    | Improve this Doc View Source

    GetNullableGuid(DbParameter)

    Gets a Nullable<Guid> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static Guid? GetNullableGuid(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.Guid>

    The parameter value as a Nullable<Guid>.

    | Improve this Doc View Source

    GetNullableInteger(DbParameter)

    Gets a Nullable<Int32> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static int? GetNullableInteger(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.Int32>

    The parameter value as a Nullable<Int32>.

    | Improve this Doc View Source

    GetNullableLong(DbParameter)

    Gets a Nullable<Int64> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static long? GetNullableLong(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.Int64>

    The parameter value as a Nullable<Int64>.

    | Improve this Doc View Source

    GetNullableShort(DbParameter)

    Gets a Nullable<Int16> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static short? GetNullableShort(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.Int16>

    The parameter value as a Nullable<Int16>.

    | Improve this Doc View Source

    GetNullableTimeSpan(DbParameter)

    Gets a Nullable<TimeSpan> value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static TimeSpan? GetNullableTimeSpan(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Nullable<System.TimeSpan>

    The parameter value as a Nullable<TimeSpan>.

    | Improve this Doc View Source

    GetShort(DbParameter)

    Gets a short (Int16) value from the output parameter.

    Declaration
    public static short GetShort(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.Int16

    The parameter value as an Int16.

    Exceptions
    Type Condition
    ArgentSea.UnexpectedNullException

    Thrown when a database null value is encountered.

    | Improve this Doc View Source

    GetString(DbParameter)

    Gets a string value from the output parameter, or null if the parameter value is DbNull.

    Declaration
    public static string GetString(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.String

    The parameter value as a string.

    | Improve this Doc View Source

    GetTimeSpan(DbParameter)

    Gets a TimeSpan value from the output parameter.

    Declaration
    public static TimeSpan GetTimeSpan(this DbParameter prm)
    Parameters
    Type Name Description
    System.Data.Common.DbParameter prm

    The output parameter, populated with a value (after Execute).

    Returns
    Type Description
    System.TimeSpan

    The parameter value as a TimeSpan.

    Exceptions
    Type Condition
    ArgentSea.UnexpectedNullException

    Thrown when a database null value is encountered.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX