John,
I'm well aware of filters, but I just could not find a way to do what
I want with a filter.
I need to have logging specific for a method (e.g. different message
on GET request and on POST request, where actual method has same name,
but different arguments).
Anyway, as a workaround, I went more hardcore way and implemented this
idea through Windsor interceptor. I just don't like how I'm always
reading attributes on each invocation - will need to figure out how to
cache them. And also it would be nice to have some kind of exception
when decorated method is not virtual, but that is a different topic...
John, if you have some specific approach in mind for how to solve my
issue with MR filter, I would still very much like to hear it.
Thanks
Artur
On 4 Lis, 04:42, John Simons <
johnsimons...@yahoo.com.au> wrote:
> Arthur, the monorail framewrk already has something that does what you want, is called Filters have a look athttp://
www.castleproject.org/monorail/documentation/trunk/usersguide/...
>
> Cheers John
>
> On 03/11/2009, at 8:38 PM, Artur Dorochowicz <
arturdorochow...@gmail.com> 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...