سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top