Hi,
Let's say I have a class "MyClass" with an interface "IMyClass".
First I register by type: builder.RegisterType<MyClass>().As<IMyClass>().SingleInstance();
Then I want to add some interceptors to all types of my assembly (or namespace)
So first I register the interceptor itself:
builder.RegisterType<CachingInterceptor>().AsSelf();
Ben then I have a problem. If I use
builder.RegisterAssemblyTypes(typeof(MyClass).assembly).EnableClassInterceptors().InterceptedBy(typeof(CachingInterceptor)
it re-registers all the types in the assembly, even if they where registered in another way before. Ans it seems to me thaht whhen you want to resolve a type, you will get an intance of the latest registration.
So basically my question is:
Is it possible to add interceptors to a type (or all types in an assembly) that is already registered, without re-registering it.
Any feedback would be nice.
Thanks