Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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/

like image 570
David Avatar asked Feb 16 '11 22:02

David


2 Answers

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

like image 59
Remo Gloor Avatar answered Nov 19 '22 18:11

Remo Gloor


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.

like image 2
BlakeH Avatar answered Nov 19 '22 17:11

BlakeH