Andrew Duffy
Andrew Duffy

Reputation: 583

Unity InjectionFactory and Interceptors

I'm trying to use an exception interceptor along with an injectionfactory like this:

container.RegisterType<IProcessorService>(
    new HierarchicalLifetimeManager(),
    new InjectionFactory(c => processorFactory.CreateChannel()),
    new Interceptor<InterfaceInterceptor>(), 
    new InterceptionBehavior<AppExceptionInterceptor>());

Only problem is the interceptor is not working. The injection factory works but not the interceptor. For other types when I do interceptors without using an injection factory everything is fine and works.

Any ideas?

Cheers for any wisdom!!

Upvotes: 0

Views: 929

Answers (1)

Andrew Duffy
Andrew Duffy

Reputation: 583

Forgot to add the interception extension to the container!

container.AddNewExtension<Interception>();

Upvotes: 1

Related Questions