Ninject Interception Extension (AOP) - Good working example/tutorial?

4.6k views Asked by At

I've been having a very difficult time finding an easy to follow tutorial or example of using the interception extension with Ninject, or ideally, a working example.

I've tried the below tutorial, but immediately had problems getting namespaces to work for the Intercept() call:

http://innovatian.com/2010/03/using-ninject-extensions-interception-part-1-the-basics/

2

There are 2 answers

0
Remo Gloor On

Have a look at the unittests that come with the source code. There is an example for each feature of the extension: https://github.com/ninject/ninject.extensions.interception/tree/master/src/Ninject.Extensions.Interception.Test

0
BlakeH On

I ran into this issue with the tutorial you linked as well. I was able to figure out the namespace you need to import is Ninject.Extensions.Interception.Infrastructure.Language;

Also, you need to reference either the Ninject.Extensions.Interception.DynamicProxy or Ninject.Extensions.Interception.LinFu implementation as well as the Ninject.Extensions.Interception package (and all dependencies). It worked like a charm after that for me.