开发者

Intercepting singleton instances

开发者 https://www.devze.com 2023-04-08 04:41 出处:网络
I\'m receiving \"Potential Lifestyle Mismatches\" Component \'MyCompon开发者_运维技巧ent\' with lifestyle Singleton depends on

I'm receiving "Potential Lifestyle Mismatches"

Component 'MyCompon开发者_运维技巧ent' with lifestyle Singleton depends on 'Castle.TypedFactory.Interceptor' with lifestyle Transient

Is there any issue using an Interceptor against multiples singletone instances?

,Component.For<ApiInterceptor>()

, AllTypes.FromAssemblyContaining<MyServiceContract>()
    .Where(Component.IsInSameNamespaceAs<MyServiceContract>())
    .Configure(c => c.Interceptors(typeof(ApiInterceptor)))
    .Configure(c => c.LifeStyle.Singleton)


It's probably fine. There's a reason why this diagnostics is called potential lifestyle mismatches.

0

精彩评论

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

关注公众号