title: how to use Ninject intercept using InterceptAttribute
body: <p>I have a NinjectWebCommon as follow. I am unable to get the TimingInterceptor to trigger on the method that has "Timing" attribute set. It works fine if the intercetor is defined at the class level where all method call is going to be intercepted, but I would like to have the ability to specify the method I want to intercept (opt in).</p>
  
  <p>I do have the <strong>Ninject.Extensions.Interception.DynamicProxy</strong> added.</p>
  
  <pre><code>public static class NinjectWebCommon 
  {
      private static readonly Bootstrapper bootstrapper = new Bootstrapper();
  
      /// &lt;summary&gt;
      /// Starts the application
      /// &lt;/summary&gt;
      public static void Start() 
      {
          DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
          DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
          bootstrapper.Initialize(CreateKernel);
      }
  
      /// &lt;summary&gt;
      /// Stops the application.
      /// &lt;/summary&gt;
      public static void Stop()
      {
          bootstrapper.ShutDown();
      }
  
      /// &lt;summary&gt;
      /// Creates the kernel that will manage your application.
      /// &lt;/summary&gt;
      /// &lt;returns&gt;The created kernel.&lt;/returns&gt;
      private static IKernel CreateKernel()
      {
          var NinjectSettings = new NinjectSettings();
          var kernel = new StandardKernel(NinjectSettings);
  
          kernel.Bind&lt;Func&lt;IKernel&gt;&gt;().ToMethod(ctx =&gt; () =&gt; new Bootstrapper().Kernel);
          kernel.Bind&lt;IHttpModule&gt;().To&lt;HttpApplicationInitializationHttpModule&gt;();
  
          GlobalConfiguration.Configuration.DependencyResolver = new BazingaNinjectResolver(kernel);
  
          RegisterServices(kernel);
          return kernel;
      }
  
      /// &lt;summary&gt;
      /// Load your modules or register your services here!
      /// &lt;/summary&gt;
      /// &lt;param name="kernel"&gt;The kernel.&lt;/param&gt;
      private static void RegisterServices(IKernel kernel)
      {
          kernel.Bind&lt;IMyService&gt;().To&lt;MyService&gt;().InRequestScope();
      }        
  }
  </code></pre>
  
  <p><strong>my Service class define as follow</strong></p>
  
  <pre><code>public class MyService : IMyService
  {
      Logger log;
  
      public MyService()
      {
          log = LogManager.GetLogger(this.GetType().FullName);
      }
  
      [Timing]
      public string GetString()
      {
          log.Info("log me!!");
          return "Cool string !!!!";
      }
  
      public string GetUnInterceptString()
      {
          return "Not intercepted";
      }
  }
  </code></pre>
  
  <p><strong>Interceptor and attribute define as follows</strong></p>
  
  <pre><code>public class TimingAttribute : InterceptAttribute
  {
      public override IInterceptor CreateInterceptor(IProxyRequest request)
      {
          return request.Context.Kernel.Get&lt;TimingInterceptor&gt;();
      }
  }
  
  public class TimingInterceptor : SimpleInterceptor
  {
      readonly Stopwatch _stopwatch = new Stopwatch();
  
      protected override void BeforeInvoke(IInvocation invocation)
      {
          _stopwatch.Start();
      }
  
      protected override void AfterInvoke(IInvocation invocation)
      {
          _stopwatch.Stop();
          string message = string.Format("Execution of {0} took {1}.",
              invocation.Request.Method,
              _stopwatch.Elapsed);
  
          _stopwatch.Reset();
      }
  }
  </code></pre>