Reputation: 2750
I'm curious if it is possible to modify the servicesstack Route mapping rules. I'd like non-query string parameters to go in one area of the model and the query string parameters to go into another.
Specifically, I have this Route:
[Route("/gis/services/{Folders*}/{ServiceName}/{ServiceType}/{LayerId}/query", HttpMethods.Get)]
public class Model : Envelope<Request>
{
}
And the Envelope is defined like this:
public class Envelope<T>
{
public string Folders { get; set; }
public string ServiceType { get; set; }
public string ServiceName { get; set; }
public int LayerId { get; set; }
public T Payload { get; set; }
}
How can I map the query string parameters into the Payload and have everything else (Folders, ServiceType, ServiceName, LayerId) map as it normally would?
Upvotes: 1
Views: 292
Reputation: 143319
Only the path info of the request are defined in ServiceStack Routes, all other properties can be populated by other Request Params like QueryString or Request Body.
{folders*}
at the end of Routes to avoid ambiguity. {ServiceName}
Service
name for Request DTOs which is used for your Services implementation classesUpvotes: 2