I am working with the new DIP (Injection Dependency) asp.net 5 https://github.com/aspnet/DependencyInjection . So far, I have done well.
But now it's time to do more complicated things. As I did in the past with Windsor Castle or Unity. I need to make a proxy for the class, intercept calls and register it.
AOP (Aspect Oriented Program)
In Windsor Castle, it's called: DinamicProxy In asp.net 5, how can I do the same?
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. Relations
source
share