Sieve.Query.Builder 1.1.2

dotnet add package Sieve.Query.Builder --version 1.1.2
                    
NuGet\Install-Package Sieve.Query.Builder -Version 1.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sieve.Query.Builder" Version="1.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sieve.Query.Builder" Version="1.1.2" />
                    
Directory.Packages.props
<PackageReference Include="Sieve.Query.Builder" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sieve.Query.Builder --version 1.1.2
                    
#r "nuget: Sieve.Query.Builder, 1.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sieve.Query.Builder@1.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sieve.Query.Builder&version=1.1.2
                    
Install as a Cake Addin
#tool nuget:?package=Sieve.Query.Builder&version=1.1.2
                    
Install as a Cake Tool

Sieve.TypeSafeQueryBuilder

Type-safe query builders for Sieve filtering, sorting, and pagination. Available for both .NET and TypeScript.

Overview

This monorepo contains type-safe query builder implementations for building Sieve-compatible query strings with compile-time safety and IntelliSense support.

Key Features

  • Type-safe - Compile-time property name checking
  • Full Sieve operator support - ==, !=, @=, _=, >, <, >=, <=
  • Fluent API - Chain methods for readable query construction
  • Multiple output formats - Query strings, objects, or SieveModel
  • Zero magic strings - Use lambda expressions (C#) or interface properties (TypeScript)

Table of cotents

Packages

TypeScript

Interface-based query builder for type-safe Sieve queries in any TypeScript application (React, Vue, Angular, etc...)

📖 Full TypeScript Documentation →

npm install ts-sieve-query-builder

Quick Example:

import { SieveQueryBuilder } from 'ts-sieve-query-builder';

const queryParams = SieveQueryBuilder.create<Author>()
  .filterContains('name', 'Bob')
  .filterGreaterThanOrEqual('createdat', thirtyDaysAgo)
  .sortByDescending('createdat')
  .page(1)
  .pageSize(20)
  .buildQueryParams();

// API request with simple fetch() 
// although type-safe API calls are preferred
const response = await fetch(`/api/authors?${queryParams}`);

.NET / C#

Due to testing, I have also made a C#/.NET equivalent, so you can perform your .NET unit tests with a typesafe query.

📖 Full .NET Documentation →

dotnet add package Sieve.TypeSafe.QueryBuilder

Quick Example:

var queryString = SieveQueryBuilder<Author>.Create()
    .FilterContains(a => a.Name, "Bob")
    .FilterGreaterThanOrEqual(a => a.CreatedAt, DateTime.Now.AddDays(-7))
    .SortByDescending(a => a.CreatedAt)
    .Page(1)
    .PageSize(20)
    .BuildQueryString();

Query Models for custom mapped properties:

// Define a query model matching your SieveProcessor configuration
public class AuthorQueryModel : ISieveQueryModel
{
    public string? Name { get; set; }
    public int? BooksCount { get; set; }  // Custom property with IntelliSense!
}

// Use it with full type safety
var query = SieveQueryBuilder<AuthorQueryModel>.Create()
    .FilterContains(a => a.Name, "Bob")
    .FilterGreaterThanOrEqual(a => a.BooksCount, 5)  // Type-safe custom property!
    .BuildQueryString();

Round-trip parsing - parse and modify queries:

// Parse incoming queries
var builder = SieveQueryBuilder<Author>
    .ParseQueryString(Request.QueryString.Value);

// Add server-side filters
builder.FilterEquals(a => a.IsDeleted, false);

// Build and apply
var results = _sieveProcessor.Apply(builder.BuildSieveModel(), dbContext.Authors);

Full-Stack Type Safety

Use with to generate TypeScript types from your C# DTOs, then use the same entity types in both the .NET backend and TypeScript frontend query builders.

Links:

Contributing

Contributions are welcome! Please open an issue or submit a pull request for either package.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.2 540 10/23/2025
1.1.1 660 10/15/2025
1.1.0 199 10/15/2025
1.0.1 198 10/14/2025
1.0.0 192 10/14/2025