Arthur, the monorail framewrk already has something that does what you want, is 
called Filters have a look at 
http://www.castleproject.org/monorail/documentation/trunk/usersguide/filters.html

Cheers John

On 03/11/2009, at 8:38 PM, Artur Dorochowicz <[email protected]> wrote:


Hello,

Is there a way to grab the method of current action in Monorail? I'm
thinking about MethodInfo object for the method or actually attributes
of the method.

I'm trying to do some logging before and after the action, they need
to be action specific. I thought about adding attributes on the method
and then reading them in some kind of Monorail filter, something like
this:

public class MyController : Controller
{
  [LogOnBeforeAction("log message")]
  [LogOnAfterAction("another log message")]
  public void MyAction() {}
}

I have seen the article here: 
http://randomcode.net.nz/2008/03/03/adding-action-filters-to-monorail-controllers/
about adding action filters, but is actually flawed - it won't work
correctly when there are multiple overloads of an action.

Regards

Artur




      
__________________________________________________________________________________
Get more done like never before with Yahoo!7 Mail.
Learn more: http://au.overview.mail.yahoo.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to