Windsor MixIn is a Singleton?

前端 未结 3 676
庸人自扰
庸人自扰 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:09

    If you register the mixin with transcient lifestyle, it will create a new instance for each component:

    container.Register(
        Component.For().ImplementedBy()
            .LifestyleTransient()
            .Proxy.MixIns(m => m.Component("mixin")),
        Component.For().LifestyleTransient().Named("mixin")
    );
    

提交回复
热议问题