src/Projac.SqlClient/SqlClientSyntax.NonQueryProcedure.cs
/// <summary>
///     Returns a T-SQL non query stored procedure.
/// </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="SqlNonQueryCommand" />.</returns>
Returns a T-SQL non query stored procedure.
Returns a T - SQL non query stored procedure .
public SqlNonQueryCommand NonQueryProcedureFormat(string format, params IDbParameterValue[] parameters)
        {
            if (parameters == null || parameters.Length == 0)
            {
                return new SqlNonQueryCommand(format, new DbParameter[0], CommandType.Text);
            }
            ThrowIfMaxParameterCountExceeded(parameters);
            return new SqlNonQueryCommand(
                string.Format(format,
                    parameters.Select((_, index) => (object)FormatDbParameterName("P" + index)).ToArray()),
                parameters.Select((value, index) => value.ToDbParameter(FormatDbParameterName("P" + index))).ToArray(),
                CommandType.StoredProcedure);
        }
public SqlNonQueryCommand NonQueryProcedureFormat ( string format , params IDbParameterValue [ ] parameters ) { if ( parameters == null || parameters . Length == 0 ) { return new SqlNonQueryCommand ( format , new DbParameter [ 0 ] , CommandType . Text ) ; } ThrowIfMaxParameterCountExceeded ( parameters ) ; return new SqlNonQueryCommand ( string . Format ( format , parameters . Select ( ( _ , index ) => ( object ) FormatDbParameterName ( " " + index ) ) . ToArray ( ) ) , parameters . Select ( ( value , index ) => value . ToDbParameter ( FormatDbParameterName ( " " + index ) ) ) . ToArray ( ) , CommandType . StoredProcedure ) ; }
Returns a T-SQL non query stored procedure.
Returns a T - SQL non query stored procedure .
None
format
string
The text with positional parameters to be formatted.
The text with positional parameters to be formatted .
parameters
<not_specific>
The positional parameter values.
The positional parameter values .