-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathSharedControllerBase.profiling.cs
51 lines (45 loc) · 1.7 KB
/
SharedControllerBase.profiling.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//-----------------------------------------------------------------------
// <copyright file="SharedControllerBase.profiling.cs" company="(none)">
// Copyright © 2013 John Gietzen and the WebGit .NET Authors. All rights reserved.
// </copyright>
// <author>John Gietzen</author>
//-----------------------------------------------------------------------
namespace WebGitNet
{
using System;
using System.Web.Mvc;
using StackExchange.Profiling;
public partial class SharedControllerBase
{
private IDisposable actionExecuting;
private IDisposable resultExecuting;
protected override void OnActionExecuted(ActionExecutedContext filterContext)
{
base.OnActionExecuted(filterContext);
if (this.actionExecuting != null)
{
this.actionExecuting.Dispose();
this.actionExecuting = null;
}
}
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
this.actionExecuting = MiniProfiler.StepStatic("Action Executing");
base.OnActionExecuting(filterContext);
}
protected override void OnResultExecuted(ResultExecutedContext filterContext)
{
base.OnResultExecuted(filterContext);
if (this.resultExecuting != null)
{
this.resultExecuting.Dispose();
this.resultExecuting = null;
}
}
protected override void OnResultExecuting(ResultExecutingContext filterContext)
{
this.resultExecuting = MiniProfiler.StepStatic("Result Executing");
base.OnResultExecuting(filterContext);
}
}
}