SQLLoggingStop() public static method

Stops logging all EF SQL Calls to the Debug Output Window
public static SQLLoggingStop ( ) : void
return void
Esempio n. 1
0
 /// <summary>
 /// Enables or Disables SqlLogging
 /// </summary>
 /// <param name="dbContext">The database context to filter logs to.</param>
 /// <param name="enable">if set to <c>true</c> [enable].</param>
 public static void SqlLogging(this System.Data.Entity.DbContext dbContext, bool enable)
 {
     if (enable)
     {
         DebugHelper.SQLLoggingStart(dbContext);
     }
     else
     {
         DebugHelper.SQLLoggingStop();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Enables or Disables SqlLogging
 /// </summary>
 /// <param name="dbContext">The database context to filter logs to.</param>
 /// <param name="enable">if set to <c>true</c> [enable].</param>
 public static void SqlLogging(this System.Data.Entity.DbContext dbContext, bool enable)
 {
     if (enable)
     {
         DebugHelper.SQLLoggingStart(dbContext);
     }
     else
     {
         _debugLoggingDbCommandInterceptor.DbContextList.Remove(dbContext);
         if (!_debugLoggingDbCommandInterceptor.DbContextList.Any())
         {
             DebugHelper.SQLLoggingStop();
         }
     }
 }