WcfIntegration을 사용하는 서비스 인터페이스를 IInterceptor와 연결하는 데 어려움을 겪고 있습니다.DynamicProxy2를 사용하는 Autofac WcfIntegration을 이용한 차단
autofac 설명서에는 각각에 대한 예제가 있지만이 두 가지를 결합한 것은 없습니다.
여기에 WcfIntegration에 대한 설명서가 있으며 DynamicProxy2 설명서를 참조하십시오.
누구나 Autofac을 사용하여 WcfIntegration으로 인터셉터를 성공적으로 연결 했습니까?
예제 코드가 나는 일을 예상 한 것 :
builder.Register(c => new CacheInterceptor())
.Named<IInterceptor>("cache-calls");
builder
.RegisterType<ChannelFactory<IEnquiryService>>()
.AsSelf()
.WithParameter(new NamedParameter("endpointConfigurationName", "EnquiryService"))
.SingleInstance();
builder
.Register(c => c.Resolve<ChannelFactory<IEnquiryService>>().CreateChannel())
.As<IEnquiryService>()
.EnableInterfaceInterceptors()
.InterceptedBy("cache-calls");
편집 :
버그가 autofac site.이에 대한 모든 작업 방법에 기록 된 것처럼 보인다?