public class MyProudAdvice : Attribute, IMethodAdvice
{
public void Advise(MethodAdviceContext context)
{
// do things you want here
context.Proceed(); // this calls the original method
// do other things here
}
}
I have my Controller base class like this:
[MyProudAdvice]
public abstract class BaseController : Controller
{
}
My HomeController inherits BaseController.
The problem is, Advise method is triggered only for constructor of HomeController, not for the Index method. If I move MyProudAdvice attribute directly to HomeController, then Advise method is correctly triggered for all methods of HomeController. How can I achieve this using my base controller class? In PostSharp this was achieved using AttributeInheritance = PostSharp.Extensibility.MulticastInheritance.Multicast, but I see no similar option in documentation.
Hello,
I have my Advice as this:
I have my Controller base class like this:
My HomeController inherits BaseController.
The problem is, Advise method is triggered only for constructor of HomeController, not for the Index method. If I move MyProudAdvice attribute directly to HomeController, then Advise method is correctly triggered for all methods of HomeController. How can I achieve this using my base controller class? In PostSharp this was achieved using AttributeInheritance = PostSharp.Extensibility.MulticastInheritance.Multicast, but I see no similar option in documentation.
Thank you!