Lets say I have a custom MyFilter : RequestFilterAttribute
that takes some constants. Like this:
[MyFilter("something")]
And it is configured on a service operation like this:
public class MyService : Service
{
[MyFilter("something")]
public MyResponse Get(MyRequest requestDto)
{
... do useful stuff here with requestDto
}
... lots of other service operations
public bool SomethingSpecial(object requestDto)
{
...do something useful with requestDto
}
}
And lets say that when the custom filter is executed it does something useful using the IRequest
before the service operation receives the actual request. This is all standard ServiceStack stuff to this point.
Now, let say that I have this filter attribute set on a bunch of service operations in my services, but there is one service operation in one service where I want to extend what the filter is doing.
So, when the request comes in, I want the filter to run, and then to delegate what it does to some custom code (SomethingSpecial()
)that is defined in my service, but only for that specific service operation, and before the service operation is called.
Is that possible? And how would it be setup?