コード例 #1
0
 public override void ScalarExecuted(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     _stopwatch.Stop();
     if (interceptionContext.Exception != null)
     {
         _logger.Error(interceptionContext.Exception, "错误命令:{0}", command.CommandText);
     }
     else
     {
         _logger.TraceApi("SQL Database", "SchoolInterceptor.ScalarExcuted", _stopwatch.Elapsed, "命令:{0}", command.CommandText);
     }
     base.ScalarExecuted(command, interceptionContext);
 }