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

                    Assert.Empty(interceptionContext.DbContexts);
                    Assert.Empty(interceptionContext.ObjectContexts);
                }
Exemplo n.º 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();
 }
Exemplo n.º 4
0
 public void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
     Log($"NonQueryExecuted after {_stopwatch.Elapsed}: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}");
 }
Exemplo n.º 5
0
 public void ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     Log($"ScalarExecuted after {_stopwatch.Elapsed}: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}");
 }
Exemplo n.º 6
0
 void IDbCommandInterceptor.ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) => AppendStackTraceToSqlCommand(command);
Exemplo n.º 7
0
 public void ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
 }
Exemplo n.º 8
0
 public void ReaderExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext <System.Data.Common.DbDataReader> interceptionContext)
 {
     OnStart(command);
 }
Exemplo n.º 9
0
 // 拦截聚合操作
 public void ScalarExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     Log(command, interceptionContext);
 }
Exemplo n.º 10
0
 public void NonQueryExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
     OnStart(command);
 }
Exemplo n.º 11
0
 // 拦截查询操作
 public void ReaderExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext <System.Data.Common.DbDataReader> interceptionContext)
 {
     Log(command, interceptionContext);
 }
Exemplo n.º 12
0
 // 拦截非查询操作
 public void NonQueryExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
     Log(command, interceptionContext);
 }
Exemplo n.º 13
0
 void IDbCommandInterceptor.ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
 }
Exemplo n.º 14
0
 void IDbCommandInterceptor.NonQueryExecuted(DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
 }
Exemplo n.º 15
0
 public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext<DbDataReader> interceptionContext)
 {
     if (ShouldLog(interceptionContext))
     {
         _log.Add(
             new CommandLogItem(
                 CommandMethod.ReaderExecuting, command, interceptionContext.Exception, interceptionContext.TaskStatus,
                 interceptionContext.IsAsync));
     }
 }
Exemplo n.º 16
0
 public void ScalarExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     OnStart(command);
 }
Exemplo n.º 17
0
            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();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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();
 }
Exemplo n.º 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();
 }
Exemplo n.º 25
0
 public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext)
 {
     _stopwatch.Restart();
     Log($"ReaderExecuting: IsAsync: {interceptionContext.IsAsync}, Command Text: {command.CommandText}");
 }
Exemplo n.º 26
0
 public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext)
 {
     RewriteJsonPath(command);
 }
Exemplo n.º 27
0
 public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext)
 {
     base.ReaderExecuting(command, interceptionContext);
     _stopwatch.Restart();
 }
Exemplo n.º 28
0
 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();
 }
Exemplo n.º 30
0
 public void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
 }
Exemplo n.º 31
0
 public void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext<int> interceptionContext)
 {
     if (ShouldLog(interceptionContext))
     {
         _log.Add(
             new CommandLogItem(
                 CommandMethod.NonQueryExecuting, command, interceptionContext.Exception, interceptionContext.TaskStatus,
                 interceptionContext.IsAsync));
     }
 }
Exemplo n.º 32
0
 public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext)
 {
     RewriteFullTextQuery(command);
 }
Exemplo n.º 33
0
 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));
     }
 }
Exemplo n.º 34
0
 public void ReaderExecuted(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext)
 {
 }
Exemplo n.º 35
0
            public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext<DbDataReader> interceptionContext)
            {
                Commands.Add(command);

                Assert.Empty(interceptionContext.DbContexts);
                Assert.Empty(interceptionContext.ObjectContexts);
            }
Exemplo n.º 36
0
 void IDbCommandInterceptor.NonQueryExecuting(DbCommand command, DbCommandInterceptionContext <int> interceptionContext) => AppendStackTraceToSqlCommand(command);