Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ninject: Possible to use injection constructor when type is being proxied for AoP?

I'm doing a project ground up using Ninject 2 and one question bugs me:

If you are to intercept methods on your type, you need to wrap it into proxy (castle dynamic proxy to be specific). Unless said type has a parameterless constructor, proxy creation fails. If it has, this constructor is being used when type instance is being resolved from the kernel.

Unfortunately, this means that my injection constructor with parameters is being neglected and I have to resort to property injection. I have some reluctance to couple my domain types with [Inject] attribute on properties.

Is there any way to use injection constructor with proxies for AoP using Ninject?

like image 879
Cortlendt Avatar asked Dec 07 '25 09:12

Cortlendt


1 Answers

See http://groups.google.com/group/ninject/browse_thread/thread/27ecdf1aafc2ec07

like image 56
Daniel Marbach Avatar answered Dec 11 '25 14:12

Daniel Marbach



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!