Intercepting singleton instances
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.
精彩评论