Search code examples
servicestackormlite-servicestack

Servicestack automap update endpoints


We are using ServiceStack QueryDb to expose certain business objects for auto-querying, and it is working great.

    [Route("/catalog/customers")]
    [Authenticate]
    public class QueryCustomers : QueryDb<ServiceModel.Catalog.Customer> { }

We'd like to implement some sort of UpdateDb that auto-maps authenticated POST, PUT and DELETE requests to insert, update and delete auto-mapped predefined OrmLite business objects, but don't see any examples on the web. Ideally, we could create an endpoint as simple as:

    [Route("/edits/customers")]
    [Authenticate]
    public class UpdateCustomers : UpdateDb<ServiceModel.Catalog.Customer> { }

I'd prefer to not have to roll our own if this has already been done somewhere in the ServiceStack library or elsewhere... Is this something that ServiceStack already supports, or are we on our own in developing this UpdateDb utility?...


Solution

  • This would require a CRUD version of AutoQuery which doesn't exist yet so you would need to implement your Update services as normal.