Windsor MixIn is a Singleton?

前端 未结 3 562
庸人自扰
庸人自扰 2021-01-26 06:25

I have a MixIn that requires some state to operate.

I am registering it as so..

    container.Register(Component.For(Of ICat) _
                        .         


        
3条回答
  •  北海茫月
    2021-01-26 07:11

    I'm not sure how it bubbles up to Windsor, but at DynamicProxy level, there's mixin Instance per proxy type. So if you're creating yourself mixin instances, you may be also each time be generating a new proxy type. To circumvent this, override Equals and GetHashCode in your mixed in type.

    I may however not be right, so you may want to make sure first.

提交回复
热议问题