public override void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext<int> interceptionContext) { CommandTexts.Add(command.CommandText); Assert.Empty(interceptionContext.DbContexts); Assert.Empty(interceptionContext.ObjectContexts); }
public void ReaderExecuted(DbCommand command, DbCommandInterceptionContext interceptionContext) { Log($"ReaderExecuted after {_stopwatch.Elapsed}: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}"); }
public override void ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { base.ScalarExecuting(command, interceptionContext); _stopwatch.Restart(); }
public void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { Log($"NonQueryExecuted after {_stopwatch.Elapsed}: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}"); }
public void ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { Log($"ScalarExecuted after {_stopwatch.Elapsed}: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}"); }
void IDbCommandInterceptor.ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) => AppendStackTraceToSqlCommand(command);
public void ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { }
public void ReaderExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext <System.Data.Common.DbDataReader> interceptionContext) { OnStart(command); }
// 拦截聚合操作 public void ScalarExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { Log(command, interceptionContext); }
public void NonQueryExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { OnStart(command); }
// 拦截查询操作 public void ReaderExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext <System.Data.Common.DbDataReader> interceptionContext) { Log(command, interceptionContext); }
// 拦截非查询操作 public void NonQueryExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { Log(command, interceptionContext); }
void IDbCommandInterceptor.ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { }
void IDbCommandInterceptor.NonQueryExecuted(DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { }
public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext<DbDataReader> interceptionContext) { if (ShouldLog(interceptionContext)) { _log.Add( new CommandLogItem( CommandMethod.ReaderExecuting, command, interceptionContext.Exception, interceptionContext.TaskStatus, interceptionContext.IsAsync)); } }
public void ScalarExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { OnStart(command); }
public override void ScalarExecuting(DbCommand command, DbCommandInterceptionContext<object> interceptionContext) { Commands.Add(command); Assert.Empty(interceptionContext.DbContexts); Assert.Empty(interceptionContext.ObjectContexts); }
public void NonQueryExecuting( DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { LogIfNonAsync(command, interceptionContext); Stopwatch.Restart(); }
public void ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { RewriteFullTextQuery(command); }
public void NonQueryExecuted( DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { Stopwatch.Stop(); LogNonQueryCommand(command, interceptionContext); }
public void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { _stopwatch.Restart(); Log($"NonQueryExecuting: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}"); }
public void ReaderExecuting( DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext) { //LogIfNonAsync(command, interceptionContext); Stopwatch.Restart(); }
public void ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { _stopwatch.Restart(); Log($"ScalarExecuting: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}"); }
public void ScalarExecuting( DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { //LogIfNonAsync(command, interceptionContext); Stopwatch.Restart(); }
public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext) { _stopwatch.Restart(); Log($"ReaderExecuting: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}"); }
public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext) { RewriteJsonPath(command); }
public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext) { base.ReaderExecuting(command, interceptionContext); _stopwatch.Restart(); }
public void ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { RewriteJsonPath(command); }
public override void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { base.NonQueryExecuting(command, interceptionContext); _stopwatch.Restart(); }
public void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { }
public void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext<int> interceptionContext) { if (ShouldLog(interceptionContext)) { _log.Add( new CommandLogItem( CommandMethod.NonQueryExecuting, command, interceptionContext.Exception, interceptionContext.TaskStatus, interceptionContext.IsAsync)); } }
public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext) { RewriteFullTextQuery(command); }
public void ScalarExecuted(DbCommand command, DbCommandInterceptionContext<object> interceptionContext) { if (ShouldLog(interceptionContext)) { _log.Add( new CommandLogItem( CommandMethod.ScalarExecuted, command, interceptionContext.Exception, interceptionContext.TaskStatus, interceptionContext.IsAsync, interceptionContext.Result)); } }
public void ReaderExecuted(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext) { }
public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext<DbDataReader> interceptionContext) { Commands.Add(command); Assert.Empty(interceptionContext.DbContexts); Assert.Empty(interceptionContext.ObjectContexts); }
void IDbCommandInterceptor.NonQueryExecuting(DbCommand command, DbCommandInterceptionContext <int> interceptionContext) => AppendStackTraceToSqlCommand(command);