private void InitializeApplication(object sender, EventArgs args)
        {
            if (!(sender is HttpApplication app))
            {
                return;
            }

            // for *each* application (this will run more than once)
            app.BeginRequest += (s, a) => _profiler.UmbracoApplicationBeginRequest(s, a);
            app.EndRequest   += (s, a) => _profiler.UmbracoApplicationEndRequest(s, a);
        }
Example #2
0
        private void InitializeApplication(object sender, EventArgs args)
        {
            if (!(sender is HttpApplication app))
            {
                return;
            }

            // for *each* application (this will run more than once)
            void beginRequest(object s, EventArgs a) => _profiler.UmbracoApplicationBeginRequest(s, a);

            app.BeginRequest += beginRequest;
            _terminate.Add(() => app.BeginRequest -= beginRequest);

            void endRequest(object s, EventArgs a) => _profiler.UmbracoApplicationEndRequest(s, a);

            app.EndRequest += endRequest;
            _terminate.Add(() => app.EndRequest -= endRequest);
        }
 private void BeginRequest(object s, EventArgs a) => _profiler.UmbracoApplicationBeginRequest(s, a);