Created
February 5, 2013 11:59
-
-
Save nootn/4714037 to your computer and use it in GitHub Desktop.
MiniProfiler.Windows IOC and AOP #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
using Castle.DynamicProxy; | |
using Snap; | |
using StackExchange.Profiling; | |
namespace ConsoleApplicationWithIocAndAop.AOP | |
{ | |
public class ProfileMethodInterceptor : MethodInterceptor | |
{ | |
public override void InterceptMethod(IInvocation invocation, MethodBase method, Attribute attribute) | |
{ | |
//Wrap each method call with a profiler step, using the method name as the step name | |
using (StackExchange.Profiling.MiniProfiler.Current.Step(method.Name)) | |
{ | |
invocation.Proceed(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment