I am working with the new DIP (Dependency Injection) of asp.net 5 https://github.com/aspnet/DependencyInjection. So far I've done pretty well.
But now it's time to do more complex things. As I have done in the past with Windsor Castle or Unity. I need to make a proxy to a class, to intercept calls and log it.
AOP (aspect oriented program)
In Windsord Castle it is called: DinamicProxy In asp.net 5 how i can make the same?
For Example:
public interface ITracingInterceptorHelper
{
void BeforeCall(string typeName, string methodName, Dictionary<string, object> parameters);
void ErrorOnCall(string typeName, string methodName, Exception e);
void AfterCall(string typeName, string methodName, object returnValue);
}
public class TracingInterceptor : BaseInterceptor, IInterceptor
{
private readonly ITracingInterceptorHelper _helper;
public TracingInterceptor(ITracingInterceptorHelper tracingInterceptorHelper)
{
_helper = tracingInterceptorHelper;
}
public void Intercept(IInvocation invocation)
{
//...
}
}
Thanks. Regards