src/Projac.SQLite/SQLiteSyntax.QueryStatement.cs
/// <summary>
///     Returns a SQL query statement.
/// </summary>
/// <param name="format">The text with positional parameters to be formatted.</param>
/// <param name="parameters">The positional parameter values.</param>
/// <returns>A <see cref="SqlQueryCommand" />.</returns>
Returns a SQL query statement.
Returns a SQL query statement .
public SqlQueryCommand QueryStatementFormat(string format, params IDbParameterValue[] parameters)
        {
            if (parameters == null || parameters.Length == 0)
            {
                return new SqlQueryCommand(format, new DbParameter[0], CommandType.Text);
            }
            return new SqlQueryCommand(
                string.Format(format,
                    parameters.Select((_, index) => (object)FormatDbParameterName("P" + index)).ToArray()),
                parameters.Select((value, index) => value.ToDbParameter(FormatDbParameterName("P" + index))).ToArray(),
                CommandType.Text);
        }
public SqlQueryCommand QueryStatementFormat ( string format , params IDbParameterValue [ ] parameters ) { if ( parameters == null || parameters . Length == 0 ) { return new SqlQueryCommand ( format , new DbParameter [ 0 ] , CommandType . Text ) ; } return new SqlQueryCommand ( string . Format ( format , parameters . Select ( ( _ , index ) => ( object ) FormatDbParameterName ( " " + index ) ) . ToArray ( ) ) , parameters . Select ( ( value , index ) => value . ToDbParameter ( FormatDbParameterName ( " " + index ) ) ) . ToArray ( ) , CommandType . Text ) ; }
Returns a SQL query statement.
Returns a SQL query statement .
None
format
string
The text with positional parameters to be formatted.
The text with positional parameters to be formatted .
parameters
The positional parameter values.
The positional parameter values .