When an application is launched, I need to know for certain methods when they are fired. How to do this using attributes and AOP techniques?
The simplest way is to record the time in the event method such as this:
private void Page_load()
{
DateTime dt = DateTime.Now;
}
And save the Datetime into a database. But this is definitely not desirable as doing this will leave the method will a lot of cross cutting functions, making the maintenance job harder. I am thinking about using attributes to solve this problem. PostSharp seems to be a good candidates here as it can intercept method calls and do whatever pre and post processing you want. But one thing that is clearly lacking is that it can't handle events without me writing a lot of custom code.
Is there any framework that can handle events naturally?