Skip to main content

Dynamic REST queries without OData or GraphQL.

Send ServiceQuery® JSON to your API. We compile it into LINQ expression trees and run it over IQueryable (EF Core, Cosmos, Mongo, in-memory, more). Injection-safe by design, with production guardrails.

  • Expression-tree compiled (no SQL string building)
  • Runs on any IQueryable provider (10+ supported)
  • 94% coverage + MIT licensed (used in ServiceBricks®)
POST /api/users/query
{
  "filters": [
    { "filterType": "equal", 
      "properties": ["Status"], 
      "values": ["Active"] },
    { "filterType": "sortdesc", 
      "properties": ["CreatedAt"] },
    { "filterType": "pagesize", 
      "values": [25] }
  ]
}

See the Pattern

One endpoint. One line of code. Any database.

Server (C#)

app.MapPost("/users/search", 
    (ServiceQueryRequest request, AppDb db) =>
{
    var queryable = db.Users.AsQueryable();
    return Results.Ok(request.Execute(queryable));
});

Client (JavaScript)

const request = new ServiceQueryRequestBuilder()
    .IsEqual("Status", "Active")
    .SortDesc("CreatedAt")
    .Paging(1, 25)
    .Build();

fetch('/users/search', {
    method: 'POST',
    body: JSON.stringify(request)
});

Same query works on EF Core, MongoDB, Cosmos, or in-memory lists.

Why ServiceQuery®?

Concrete differentiators, not marketing adjectives.

Expression-Tree Security

We don't build SQL strings. We compile expression trees. SQL injection through query text isn't possible.

No Protocol Surface Area

Unlike OData, no special endpoints or metadata. Just JSON POST to any controller you already have.

Provider Agnostic

Any LINQ provider works. SQL Server, PostgreSQL, MongoDB, Cosmos DB, in-memory — same syntax, same behavior.

Clear Boundaries

Know what you're getting. Know what you're not.

ServiceQuery® Is For

  • List endpoints where users need filtering and sorting
  • REST APIs that don't want OData/GraphQL overhead
  • Teams who want dynamic queries without dynamic SQL

ServiceQuery® Is Not

  • A replacement for GraphQL graph traversal
  • A public, unguarded query interface (use guardrails)
  • For deeply nested joins or navigation properties
Supported Database Providers

One Syntax, 10+ Providers

Same query works across SQL Server, PostgreSQL, MySQL, SQLite, MongoDB, Cosmos DB, Azure Tables, and any IQueryable source.

SQL Server
PostgreSQL
MongoDB
Cosmos DB
MySQL
SQLite
Azure Tables
In-Memory Lists

Production Ready

Built for real systems, not just demos.

94%

Code Coverage

MIT

Licensed

10+

Providers

.NET 6-10

Supported

0

Dependencies

Paging defaults

Built-in page size limits

Complexity limits

Cap filter depth and predicates

Cancellation tokens

Async-friendly, cancellable

Observability hooks

Logging and metrics support

Part of

The ServiceBricks® Ecosystem

ServiceQuery® works standalone with zero dependencies. It also powers all querying for ServiceBricks®, our open-source microservices foundation.

Generate complete .NET solutions from natural language. ServiceQuery® handles all the data access.

Visit ServiceBricks.com

Open Source & Free Forever

MIT licensed. Use it commercially. View the source. Join the community.