Is there an ActionFilter
equivalent for methods in c# itself?
In controllers you can have a custom filter which does a task OnActionExecuted
and OnActionExecuting
but i'd like to do a similar thing on methods inside a class as well.
So i'd like to do:
[MyMethodFilter]
public static string Convert(string source)
{
//DO STUFF
//RETURN A STRING
}
The IActionFilter
interface is part of System.Web.Mvc