You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Interface interception doesn't work if the interface is implemented by a base type of the implementing type #17
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.
Activity