Blaž Miheljak - 355 - Feb 3, 2015

Mike Mertsock:

I didn’t see an obvious way to do it, so maybe there’s a better way, but here’s what we do (assumes ServiceStack is hosted in ASP.NET application):

    GlobalRequestFilters.Add((request, res, dto) => {
        HttpContext.Current.Items[“CurrentIRequest”] = request;
        HttpContext.Current.Items[“CurrentDTO”] = dto;
    });

Then in your validation filter you can access HttpContext.Current.Items["…"] to retrieve these objects.