public override void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext<int> interceptionContext)
                {
                    CommandTexts.Add(command.CommandText);

                    Assert.Empty(interceptionContext.DbContexts);
                    Assert.Empty(interceptionContext.ObjectContexts);
                }
示例#2
0
 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();
 }
示例#4
0
 public void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
     Log($"NonQueryExecuted after {_stopwatch.Elapsed}: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}");
 }
示例#5
0
 public void ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     Log($"ScalarExecuted after {_stopwatch.Elapsed}: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}");
 }
示例#6
0
 void IDbCommandInterceptor.ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) => AppendStackTraceToSqlCommand(command);
示例#7
0
 public void ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
 }
示例#8
0
 public void ReaderExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext <System.Data.Common.DbDataReader> interceptionContext)
 {
     OnStart(command);
 }
示例#9
0
 // 拦截聚合操作
 public void ScalarExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     Log(command, interceptionContext);
 }
示例#10
0
 public void NonQueryExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
     OnStart(command);
 }
示例#11
0
 // 拦截查询操作
 public void ReaderExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext <System.Data.Common.DbDataReader> interceptionContext)
 {
     Log(command, interceptionContext);
 }
示例#12
0
 // 拦截非查询操作
 public void NonQueryExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
     Log(command, interceptionContext);
 }
示例#13
0
 void IDbCommandInterceptor.ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
 }
示例#14
0
 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));
     }
 }
示例#16
0
 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();
 }
示例#19
0
 public void ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     RewriteFullTextQuery(command);
 }
 public void NonQueryExecuted(
     DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
     Stopwatch.Stop();
     LogNonQueryCommand(command, interceptionContext);
 }
示例#21
0
 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();
 }
示例#23
0
 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();
 }
示例#25
0
 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);
 }
示例#27
0
 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();
 }
示例#30
0
 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));
     }
 }
示例#32
0
 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));
     }
 }
示例#34
0
 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);
            }
示例#36
0
 void IDbCommandInterceptor.NonQueryExecuting(DbCommand command, DbCommandInterceptionContext <int> interceptionContext) => AppendStackTraceToSqlCommand(command);