Now with schema-driven CRUD UIs at /auto

One line of C#.
A complete data API.

AutoQuery turns a typed Request DTO into a fully queryable, paged, filterable, authorized Query & CRUD API - then renders its own admin UI, its own typed clients and its own AI capabilities from the same declaration.

// this is the whole API
public class QueryBookings : QueryDb<Booking> { }
/auto
Searchable AutoQuery data model gallery Generated Booking CRUD grid AutoQuery filters, ordering and pagination Schema-generated Create Booking form Reference lookup generated from model metadata

Every screen above is generated at runtime - no frontend project, no scaffolding step.

1 line
To expose a fully queryable typed API
4 sources
RDBMS, In Memory, Services & DynamoDB
3 UI kits
Vue, React & Blazor components
15 langs
End-to-end typed clients, generated

One declaration, many surfaces

Declare the API. Everything else is generated.

AutoQuery uses conventions to complete the API you would have written by hand - then the same typed contract drives your UIs, your clients and your AI capabilities.

Bookings.cs
[Route("/bookings")]
public class QueryBookings : QueryDb<Booking> { }

public class CreateBooking
    : ICreateDb<Booking>, IReturn<IdResponse>
{
    [ValidateNotEmpty]
    public string Name { get; set; }
    public RoomType RoomType { get; set; }
    public DateTime StartDate { get; set; }
}

Add validation, declarative attributes and auth rules to refine both the API and everything generated from it.

A better alternative to OData, GraphQL & JSON:API

No opaque query language, no bespoke client runtime, no second schema to maintain. AutoQuery APIs are just clean REST services - usable from a browser address bar.

Clean, linkable URLs

Queries are ordinary query strings, so any result is a durable link a stakeholder can bookmark or drop into Excel.

/bookings?RoomType=Queen&orderBy=-StartDate

Optional typing

Start contract-less for rapid prototyping, then formalize the API by decorating the Request DTO - without breaking the Service Contract.

public int? AgeGreaterThan { get; set; }

Yours to override

Join tables, project custom results, change per-field behavior or replace the implementation entirely - it's a normal ServiceStack Service.

QueryDb<Rockstar,CustomRockstar>

Instant Admin UI

Open /auto and the App is already there

A searchable list of your data models, and behind each one a working CRUD App with a results grid, paging, sorting, filters, saved preferences, Create and Edit forms, reference lookups and guarded Delete actions.

Generated Booking CRUD grid
  • Authorization shapes the App. A model is only listed when its Query API is accessible; Create, Edit and Delete appear only when those APIs exist and the signed-in user can call them.
  • Query state lives in the URL. A filtered view can be bookmarked, refreshed or shared - it's a durable link back to the same server-side query.
  • Patch sends only what changed. Clearing a field adds ServiceStack's reset instruction, so "set to empty" and "leave unchanged" stay distinguishable.
  • Foreign keys become live lookups. [Ref] and [References] render a searchable picker instead of asking users to remember that Customer 1042 is Acme Inc.

Schemas

One portable contract, any renderer

An API Schema describes one endpoint. An AutoQuery Schema describes the whole data capability - its Query API, returned model and every authorized Create, Update, Patch, Delete or Save API, in one document.

GET /auto/Booking.json
{
  "name": "Booking",
  "primaryKey": "Id",
  "model":  { "type": "object", "properties": {} },
  "query":  { "$id": "/api/QueryBookings", "method": "GET" },
  "create": { "$id": "/api/CreateBooking", "method": "POST" },
  "update": { "$id": "/api/UpdateBooking", "method": "PATCH" },
  "delete": { "$id": "/api/DeleteBooking", "method": "DELETE" }
}

Opening a model loads only that schema, so an App can grow from ten APIs to ten thousand without making a single form ten thousand times heavier.

Schema-generated approval form in AI Chat

The foundation for AI-operated data

Because each write operation carries its own schema, AI Chat renders an editable preview and approval form whenever a Model proposes an AutoQuery Create, Update, Patch, Delete or Save - for every model, with no per-API Chat component to write.

“Find products below their reorder threshold and prepare updates for approval.”

Components

AutoQueryGrid in your framework of choice

The generated pages aren't a separate UI framework - they're built from the same components published for Vue, React and Blazor. Drop a full CRUD grid into your own App in one tag.

Bookings.vue
<AutoQueryGrid type="Booking" />

@servicestack/vue ships AutoQueryGrid, DataGrid, Auto Forms, reference lookups and the full Tailwind input suite.

Vue AutoQueryGrid reference lookup

Generate the APIs too

Point it at a database. Or describe the App.

AutoGen

The fastest way to ServiceStack-ify an existing system. Connect your database and AutoGen generates typed end-to-end HTTP Services for every table - then augment the generated types with your App's conventions, or "eject" them and continue code-first.

services.AddPlugin(new AutoQueryFeature {
    GenerateCrudServices = new() { AutoRegister = true }
});
AutoGen Docs

CRUD APIs & UI Generator

Describe the App you want in a sentence and generate the TypeScript data models, AutoQuery CRUD APIs and a working Blazor UI from it - or reverse-engineer models from an existing database.

AutoQuery Services are ServiceStack Services

Same Request Pipeline, same user-defined routes, same registered formats, same typed Service Clients - so everything you already know still applies.

Clean data formats, flexible integrations

Because AutoQuery Services are pure HTTP APIs available in multiple formats, a stakeholder can turn any query into a live Excel data source - no export job, no BI tool, just the URL.

/bookings.csv?RoomType=Queen&orderBy=-StartDate
AutoQuery CSV as a live Excel data source

Get Started

Three steps from an empty project to a working data App.

1

Start from a project template

Most templates already ships with AutoQuery pre-configured, so the quickest start is to pick the stack you want:

$npx create-net react-spa ProjectName

Or customize one at servicestack.net/start, or browse all project templates.

2

Declare your API & migrate the table

AutoQueryFeature is already registered, so all that's left is the Request DTO for the API you want:

public class QueryBookings : QueryDb<Booking> { }

AutoQuery queries a real RDBMS table, so its Data Model needs to exist in the database. Add it to a DB Migration and apply it with:

$npm run migrate

See DB Migrations for schema changes, AutoQuery RDBMS for query conventions and AutoQuery CRUD for write APIs.

Watch a multi-user Booking System built from an empty project

Full walkthrough in the Bookings CRUD demo.

Stop writing CRUD. Declare it.

Your Request DTOs already describe your data. AutoQuery turns that description into the API, the admin UI, the typed clients and the AI capability - and keeps them in sync for free.