SqlConnectionPlus 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.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: RentADeveloper.SqlConnectionPlus.SqlStatements
    Assembly: RentADeveloper.SqlConnectionPlus.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

    | Edit this page View Source

    InterpolatedSqlStatement(int, int)

    Initializes a new instance of this type.

    Declaration
    public InterpolatedSqlStatement(int literalLength, int formattedCount)
    Parameters
    Type Name Description
    int literalLength

    The length of the interpolated string.

    int formattedCount

    The number of expressions used in the interpolated string.

    Remarks

    This constructor is part of the interpolated string handler pattern. It is not intended to be called by user code.

    | Edit this page View Source

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

    Initializes a new instance of this type.

    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

    parameters is null.

    ArgumentException

    parameters contains a duplicate parameter.

    Methods

    | Edit this page View Source

    AppendFormatted<T>(T?, int, string?)

    Appends the specified value to this instance.

    Declaration
    public void AppendFormatted<T>(T? value, int alignment = 0, string? format = null)
    Parameters
    Type Name Description
    T value

    The value to append.

    int alignment

    The minimum number of characters that should be written for value. A negative value indicates that the value should be left-aligned and the required minimum whitespace characters to add is the absolute value.

    string format

    The string to use to format value.

    Type Parameters
    Name Description
    T

    The type of value to append.

    Remarks

    This method is part of the interpolated string handler pattern. It is not intended to be called by user code.

    | Edit this page View Source

    AppendLiteral(string?)

    Appends the specified literal value to this instance.

    Declaration
    public void AppendLiteral(string? value)
    Parameters
    Type Name Description
    string value

    The literal value to append to this instance.

    Remarks

    This method is part of the interpolated string handler pattern. It is not intended to be called by user code.

    | Edit this page View Source

    Equals(InterpolatedSqlStatement)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(InterpolatedSqlStatement other)
    Parameters
    Type Name Description
    InterpolatedSqlStatement other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    | Edit this page View Source

    Equals(object?)

    Indicates whether this instance and a specified object are equal.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current instance.

    Returns
    Type Description
    bool

    true if obj and this instance are the same type and represent the same value; otherwise, false.

    Overrides
    ValueType.Equals(object)
    | Edit this page 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
    | Edit this page View Source

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A 32-bit signed integer that is the hash code for this instance.

    Overrides
    ValueType.GetHashCode()
    | Edit this page View Source

    ToString()

    Returns the fully qualified type name of this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The fully qualified type name.

    Overrides
    ValueType.ToString()

    Operators

    | Edit this page 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.

    | Edit this page 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
    | Edit this page 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>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX