According to Mythz ( Getting a ServiceStack to store type information ), he recommends not using inheritance in DTO. What about a use case when I want each request to optionally provide an API key or location parameter? Are interfaces bad to use, but are abstract classes ok? Anyone have any recommendations?
In your use case, "each request does not necessarily provide an API key or location parameter" is traditionally processed in SS through filter attributes
Here is an example where the required authorization header is managed both on the server side and on the client side.
Given the correct requirements, Mythz recommended using the user interface in the DTO: "Request a DTO that implements the ITenant user interface that has the Tenant property. Another solution is to use the IHttpRequest.Tennant () extension method, which you can reuse inside all the services that check AbsoluteUri or RawUrl properties. " See this comment: ( Multi-tenant ServiceStack API, same deployment to respond to requests for different host names? )
I use interfaces and then check the implementation of the interface in the query filter.
Source: https://habr.com/ru/post/1501036/More articles:How to get entitymanager programming interface in Spring? - springCrash on crash - androidFacebook sdk 3.0 android - androidD3.js Flood Map Killer - performanceMaven Jetty OutOfMemoryError plugin when sharing an instance between two web applications - javaC Massive loop - cBASH - How to extract data from a column in a CSV file and put it in an array? - arrayshttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1501039/c-ways-to-pass-function-as-argument-to-function&usg=ALkJrhiCmEBydjT8_JxG0klwZndmOGV6_QHow to customize target element embedded in HTML / CSS code? - htmlHow to prevent OpenJPA 2.2.2 from adding an additional cross-connection for a multi-root query - openjpaAll Articles