コード例 #1
0
        public static void UseDebug(this IAppBuilder app, DebugOptions options = null)
        {
            if (options == null)
            {
                options = new DebugOptions();
            }

            app.Use <Debug>(options);
        }
コード例 #2
0
ファイル: Debug.cs プロジェクト: crzsec14/MVCTrainingProject
        public Debug(AppFunc next, DebugOptions options)
        {
            _next    = next;
            _options = options;

            if (_options.OnIncomingRequest == null)
            {
                _options.OnIncomingRequest = (ctx) => {
                    Console.WriteLine("Incoming Request: " + ctx.Request.Path);
                }
            }
            ;

            if (_options.OnOutgoingRequest == null)
            {
                _options.OnOutgoingRequest = (ctx) =>
                {
                    Console.WriteLine("Outgoing Request: " + ctx.Request.Path);
                }
            }
            ;
        }