コード例 #1
0
                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}");
 }
コード例 #3
0
 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)
 {
 }
コード例 #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));
     }
 }
コード例 #16
0
 public void ScalarExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     OnStart(command);
 }
コード例 #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();
 }
コード例 #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}");
 }
コード例 #26
0
 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();
 }
コード例 #28
0
 public void ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     RewriteJsonPath(command);
 }
コード例 #29
0
 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)
 {
 }
コード例 #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));
     }
 }
コード例 #32
0
 public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext)
 {
     RewriteFullTextQuery(command);
 }
コード例 #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));
     }
 }
コード例 #34
0
 public void ReaderExecuted(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext)
 {
 }
コード例 #35
0
            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);