/// <summary> /// Begins the scope. /// </summary> /// <typeparam name="TState"></typeparam> /// <param name="state"></param> /// <returns></returns> public IDisposable BeginScope <TState>(TState state) { if (state == null) { throw new ArgumentNullException(nameof(state)); } return(SqlLoggerScope.Push("SqlLogger", state)); }
public static IDisposable Push(string name, object state) { var temp = Current; Current = new SqlLoggerScope(name, state); Current.Parent = temp; return(new DisposableScope()); }