DbConnectionPlus API Documentation
Search Results for

    Show / Hide Table of Contents

    Struct InterpolatedSqlStatement

    Represents an SQL statement constructed using interpolated string syntax.

    Implements
    IEquatable<InterpolatedSqlStatement>
    Inherited Members
    object.GetType()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: RentADeveloper.DbConnectionPlus.SqlStatements
    Assembly: RentADeveloper.DbConnectionPlus.dll
    Syntax
    public struct InterpolatedSqlStatement : IEquatable<InterpolatedSqlStatement>
    Remarks

    This type enables passing values as parameters and sequences of values as temporary tables to SQL statements via expressions inside interpolated strings. Therefore, this type implements the C# interpolated string handler pattern (see https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/interpolated-string-handler).

    Constructors

    View Source

    InterpolatedSqlStatement(string, params (string Name, object? Value)[])

    Initializes a new instance of the InterpolatedSqlStatement class from the specified SQL code and parameters.

    Declaration
    public InterpolatedSqlStatement(string code, params (string Name, object? Value)[] parameters)
    Parameters
    Type Name Description
    string code

    The code of the SQL statement.

    (string Name, object Value)[] parameters

    The parameters of the SQL statement.

    Remarks

    If a parameter value is an Enum, it is serialized according to EnumSerializationMode.

    Exceptions
    Type Condition
    ArgumentNullException
    • code is null.
    • parameters is null.
    ArgumentException

    parameters contains a duplicate parameter.

    Methods

    View Source

    Equals(InterpolatedSqlStatement)

    Declaration
    public readonly bool Equals(InterpolatedSqlStatement other)
    Parameters
    Type Name Description
    InterpolatedSqlStatement other
    Returns
    Type Description
    bool
    View Source

    Equals(object?)

    Declaration
    public override readonly bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)
    View Source

    FromString(string)

    Creates a new instance of InterpolatedSqlStatement from the specified string.

    Declaration
    public static InterpolatedSqlStatement FromString(string value)
    Parameters
    Type Name Description
    string value

    The string from which to create an instance of InterpolatedSqlStatement.

    Returns
    Type Description
    InterpolatedSqlStatement
    Exceptions
    Type Condition
    ArgumentNullException

    value is null.

    View Source

    GetHashCode()

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()
    View Source

    ToString()

    Declaration
    public override readonly string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    Operators

    View Source

    operator ==(InterpolatedSqlStatement, InterpolatedSqlStatement)

    Determines whether the two specified instances of InterpolatedSqlStatement are equal.

    Declaration
    public static bool operator ==(InterpolatedSqlStatement left, InterpolatedSqlStatement right)
    Parameters
    Type Name Description
    InterpolatedSqlStatement left

    The first instance to compare.

    InterpolatedSqlStatement right

    The second instance to compare.

    Returns
    Type Description
    bool

    true if the two specified instances of InterpolatedSqlStatement are equal; otherwise, false.

    View Source

    implicit operator InterpolatedSqlStatement(string)

    Implicitly converts a string to an instance of InterpolatedSqlStatement.

    Declaration
    public static implicit operator InterpolatedSqlStatement(string value)
    Parameters
    Type Name Description
    string value

    The string to convert to an instance of InterpolatedSqlStatement.

    Returns
    Type Description
    InterpolatedSqlStatement
    Exceptions
    Type Condition
    ArgumentNullException

    value is null.

    View Source

    operator !=(InterpolatedSqlStatement, InterpolatedSqlStatement)

    Determines whether the two specified instances of InterpolatedSqlStatement are unequal.

    Declaration
    public static bool operator !=(InterpolatedSqlStatement left, InterpolatedSqlStatement right)
    Parameters
    Type Name Description
    InterpolatedSqlStatement left

    The first instance to compare.

    InterpolatedSqlStatement right

    The second instance to compare.

    Returns
    Type Description
    bool

    true if the two the specified instances of InterpolatedSqlStatement are unequal; otherwise, false.

    Implements

    IEquatable<T>
    • View Source
    In this article
    Back to top Generated by DocFX