Q:

Get defined Route from Dto

I've created a basic Dto Hit tracker that counts how many times a ServiceStack API is requested. What I'm trying to get now is the Route that was defined for the current Dto in the ServiceBase using Routes.Add. I can get current Url from the HttpContext, however that one is already populated with data. E.g
//Defined Route
/customers/{CustomerID}/orders

//From HttpContext
/customers/123456/orders

Is there way to get the defined route with the parameter {CustomerID} still there?

A:

You can get the Route for the Request with IRequest.GetRoute().
Also if you want to create a Request DTO from a path or URL you can use Metadata.CreateRequestFromUrl() added in the latest v5.1 Release Notes.

