开发者

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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜