I have a service:
[SomeResponse]
public class SomeService : ServiceBase {
public string[] CacheMemory{ get; set; }
//....
}
public class SomeResposeAttribute : ResponseFilterAttribute {
public override void Execute(IHttpRequest req, IHttpResponse res, object requestDto) {
//I want to access SomeService->CacheMemory here?? How?
}
}
Now, if I need to do something to CacheMemory
in response attribute before I send it back. How do I get access to it? Thank you.
The Filter Attributes don't have access to the Service instance, you'd use the
IRequest.Items
dictionary in to pass objects to different handlers throughout ServiceStack's Request Pipeline, e.g: