Skip to content

SqlHelper.Execute method (1 of 3)

Executes the specified query on the connection.

public static void Execute(this SqlInsert query, IDbConnection connection, ILogger? logger = null)
parameter description
query The query.
connection The connection.
logger The logger.

See Also


SqlHelper.Execute method (2 of 3)

Executes the specified delete query on the connection and returns the number of affected rows.

public static int Execute(this SqlDelete query, IDbConnection connection, 
    ExpectedRows expectedRows = ExpectedRows.One, ILogger? logger = null)
parameter description
query The query.
connection The connection.
expectedRows The expected rows. Used to validate the expected number of affected rows.
logger The logger.

Return Value

The number of affected rows.

See Also


SqlHelper.Execute method (3 of 3)

Executes the specified update query on the connection and returns the number of affected rows.

public static int Execute(this SqlUpdate query, IDbConnection connection, 
    ExpectedRows expectedRows = ExpectedRows.One, ILogger? logger = null)
parameter description
query The query.
connection The connection.
expectedRows The expected rows. Used to validate the expected number of affected rows.
logger The logger.

Return Value

The number of affected rows.

See Also