I work with the backend, primarily oriented to the ServiceStack API and the Typescript front-end interface (with ServiceStack JsonServiceClient) that interacts with it. This is a large project, so scalability is very important, and our goal is to ensure strong application at all levels. So far things have been going well, but I am facing this problem.
We have an object that I will name Gadget:
public class GadgetDto
{
public int Id { get; set; }
}
Through AutoQuery, we have an endpoint that returns a list of Gadgets:
[Route("/query/gadgets", HttpMethods.Get)]
public class QueryableGadget : QueryData<GadgetDto>
{
}
However, there was a need to create several Gadgets classes , so instead I reorganized the gadgets to be derived from the base class and interface:
public interface IGadget
{
int Id { get; set; }
}
public abstract class GadgetBase : IGadget
{
public int Id { get; set; }
}
public class TabbedGadget : GadgetBase
{
public List<Tab> Tabs { get; set; }
}
:
[Route("/query/gadgets", HttpMethods.Get)]
public class QueryableGadget : QueryData<IGadget>
. QueryData, List<IGadget>, , .
, , Typescript, , GadgetBase TabbedGadget. , , API, , Typescript, , IGadget .
, - ServiceStack , "" Typescript (/types/typescript)?
!