Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can ninject intercept private methods?

I would like to know if its possible for ninject to intercept private methods on my class. im trying to do some aop programming to dynamically inject the logging mechanism.

like image 212
Ronnel Avatar asked Dec 19 '25 15:12

Ronnel


1 Answers

Unfortunately, all methods to be intercepted must be virtual [and hence not private].

See this blog series by @Ian Davis for a flavour of what Ninject.Extensions.Interception majors in.

Deeper AOP on the .NET platform is typically the realm of PostSharp, which provides hihg and low level AOP abstractions of all kinds.

like image 134
Ruben Bartelink Avatar answered Dec 24 '25 09:12

Ruben Bartelink



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!