Vagif Abilov
Vagif Abilov

Reputation: 9991

Can ServiceStack operation naming convention be overriden?

I need to define a DTO class for a ServiceStack service. Service stack uses convention based on class names, so if my class is called Transmission, the corresponding service will use expose metadata with a type "Transmission" used in HTTP operations.

But I already have Transmission class - the one my DTO object will be mapped to. To avoid confusion I want to define TransmissionRequest DTO (probably something better than just "Request" suffix) but keep "Transmission" in exposed service metadata. I don't find a way to override the ServiceStack convention, so it calls types exposed in service operations after their respective C# classes.

Is there a way to override exposed types (e.g. using attributes) or this is hard wired convention that can't be customized?

Upvotes: 3

Views: 125

Answers (1)

mythz
mythz

Reputation: 143284

See the Auto-Route Generation Strategies in the Routing wiki for different ways of customizing, removing or injecting different auto-route generated strategies.

Upvotes: 2

Related Questions