Open
Description
The following code illustrates the problem:
public interface ITestCalls
{
void Test1();
}
public abstract class BaseTestCalls : ITestCalls
{
public void Test()
{
}
}
[Tag("track")]
public class TrackTestCalls : BaseTestCalls
{
}
[Tag("track1")]
public class TrackTestCalls1 : ITestCalls
{
public void Test()
{
}
}
static void Main(string[] args)
{
IUnityContainer container = new UnityContainer();
container.AddNewExtension<Interception>();
container
.Configure<Interception>()
.AddPolicy("track")
.AddMatchingRule<TagAttributeMatchingRule>(
new InjectionConstructor("track", false))
.AddCallHandler<TrackCallHandler>(
new ContainerControlledLifetimeManager())
;
container
.RegisterType<ITestCalls, TrackTestCalls>(
"track",
new InterceptionBehavior<PolicyInjectionBehavior>(),
new Interceptor<TransparentProxyInterceptor>())
.RegisterType<ITestCalls, TrackTestCalls1>(
"track1",
new InterceptionBehavior<PolicyInjectionBehavior>(),
new Interceptor<TransparentProxyInterceptor>())
;
var test = container.Resolve<ITestCalls>("track");
test.Test();
var test1 = container.Resolve<ITestCalls>("track1");
test1.Test();
}
test.Test() does not exhibit the decorated behavior and the object test is not supplied with a pipeline. However test1.Test() behaves as expected and test1 has the pipeline.
I could not find this being documented anywhere.