BaseCommandInterceptor
The BaseCommandInterceptor
class has these methods that you can override:
public virtual bool ExecuteScalar(string sql, ref object returnValue); public virtual bool ExecuteNonQuery(string sql, ref int returnValue); public virtual bool ExecuteReader(string sql, CommandBehavior behavior, ref MySqlDataReader returnValue); public virtual void Init(MySqlConnection connection);
If your interceptor overrides one of the Execute...
methods, set the returnValue
output parameter and return true
if you handled the event, or false
if you did not handle the event. The SQL command is processed normally only when all command interceptors return false
.
The connection passed to the Init
method is the connection that is attached to this interceptor.
For full usage and examples, see , "Using the Connector/Net Interceptor Classes".