示例#1
0
        /// <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));
        }
示例#2
0
        public static IDisposable Push(string name, object state)
        {
            var temp = Current;

            Current        = new SqlLoggerScope(name, state);
            Current.Parent = temp;

            return(new DisposableScope());
        }