I have an interface need inherit other interfaces. But when I inherit the generics interface and call it method the AbstractInterceptorAttribute isn't work fine.
var app = builder.Build();
using var scop = app.Services.CreateScope();
var bService = scop.ServiceProvider.GetRequiredService();
bService.TestA();
bService.TestB();
bService.TestGeneric1();
bService.TestGeneric2();
If I use this case in `Castle.Core` library everything work fine see demo [project](https://github.com/changemyminds/Reproduce.AspectCore_Framework.Bugs/tree/use/Castle.Core). But I like
`AspectCore-Framework` library anybody can help ?
I have an interface need inherit other interfaces. But when I inherit the generics interface and call it method the
AbstractInterceptorAttribute
isn't work fine.Here is reproduce example.
public interface IGenericService
{
T TestGeneric1();
}
public interface IAService { void TestA(); }
public interface IBService : IAService, IGenericService
{
void TestB();
}
public class TestService : IBService { public void TestA() { System.Console.WriteLine("Call TestA"); }
}
var builder = WebApplication.CreateBuilder(args); builder.Services.AddSingleton<IBService,TestService>(); builder.Services.AddSingleton();
builder.Services.ConfigureDynamicProxy(config =>
{
config.Interceptors.AddServiced(
Predicates.ForService("*Service")
);
});
builder.Host.UseServiceProviderFactory(new DynamicProxyServiceProviderFactory());
var app = builder.Build(); using var scop = app.Services.CreateScope(); var bService = scop.ServiceProvider.GetRequiredService();
bService.TestA();
bService.TestB();
bService.TestGeneric1();
bService.TestGeneric2();
AspectCore_Framework.Bugs.TestService, TestA Call TestA AspectCore_Framework.Bugs.TestService, TestB Call TestB AspectCore_Framework.Bugs.TestService, TestGeneric1 Call TestGeneric1 AspectCore_Framework.Bugs.TestService, TestGeneric2 Call TestGeneric2
AspectCore_Framework.Bugs.TestService, TestA Call TestA AspectCore_Framework.Bugs.TestService, TestB Call TestB Call TestGeneric1 Call TestGeneric2