I created a couple of custom attributes that I attach to my methods in the handlers. The custom attributes are more than mere 'taggers' like e.g. 'RequiresAuthenticationAttribute'. A simplified example:
[EnforceParam("Account")]
In my interceptor, that gets called for methods annotated with EnforceParam, I'd like to get access to the value "Account". What I'm currently doing for that is this:
public override bool BeforeExecute(IOperation operation)
{
ReflectionBasedMethod method = (ReflectionBasedMethod)((MethodBasedOperation)operation).Method;
MethodInfo methodInfo = method.MethodInfo;
For that to work, I had to add the 'Method' property to OpenRasta's ReflectionBasedMethod.
Can the same be accomplished without hacking OpenRasta (I'm on 2.0 btw)?