Rock.DebugHelper.SQLLoggingStart C# (CSharp) Méthode

SQLLoggingStart() public static méthode

Starts logging all EF SQL Calls to the Debug Output Window as T-SQL Blocks
public static SQLLoggingStart ( RockContext rockContext = null ) : void
rockContext RockContext The rock context to limit the output to. Leave blank to show output for all rockContexts.
Résultat void
        public static void SQLLoggingStart( RockContext rockContext = null )
        {
            _callCounts = 0;
            SQLLoggingStop();
            _debugLoggingDbCommandInterceptor.RockContext = rockContext;
            DbInterception.Add( _debugLoggingDbCommandInterceptor );
        }

Usage Example

Exemple #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();
     }
 }
All Usage Examples Of Rock.DebugHelper::SQLLoggingStart