CoreOne.OQuery 1.0.0

dotnet add package CoreOne.OQuery --version 1.0.0
                    
NuGet\Install-Package CoreOne.OQuery -Version 1.0.0
                    
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="CoreOne.OQuery" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoreOne.OQuery" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CoreOne.OQuery" />
                    
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 CoreOne.OQuery --version 1.0.0
                    
#r "nuget: CoreOne.OQuery, 1.0.0"
                    
#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 CoreOne.OQuery@1.0.0
                    
#: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=CoreOne.OQuery&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CoreOne.OQuery&version=1.0.0
                    
Install as a Cake Tool

CoreOne.OQuery

A lightweight query language engine for .NET. Write human-readable filter expressions and evaluate them against any IQueryable<T> — no configuration required.

Install

dotnet add package CoreOne.OQuery

Quick Start

using CoreOne.OQuery.Extensions;
using CoreOne.OQuery.Lexer;
using CoreOne.OQuery.Parser;

// 1. Parse a query string into an AST
var tokens = new Lexer("status = \"open\" AND priority >= 3 LIMIT 20").Tokenize();
var query  = new Parser(tokens).Parse();

// 2. Apply it to any IQueryable<T>
var results = dbContext.Tickets.Apply(query).ToList();

// 3. Or get an Expression<Func<T, bool>> for manual use
Expression<Func<Ticket, bool>> predicate = dbContext.Tickets.ToPredicate<Ticket>(query);

// 4. Project to a dictionary (dynamic field selection)
IEnumerable<Dictionary<string, object?>> rows = dbContext.Tickets.Project(query).ToList();

Query Syntax

Filtering

Syntax Example
Equality status = "open"
Inequality status != "closed"
Comparison priority >= 3
IN list label IN ("bug", "urgent")
Logical AND status = "open" AND priority > 2
Logical OR priority > 4 OR label = "urgent"
Logical NOT NOT status = "closed"
Grouping (status = "open" OR priority > 3) AND assignee = "alice"
Nested property user.address.city = "Berlin"

Built-in Functions

Function Description Example
contains(prop, value) String contains contains(assignee, "ali")
startsWith(prop, value) String starts with startsWith(status, "op")
endsWith(prop, value) String ends with endsWith(label, "ent")

Field Projection (SELECT)

status = "open" SELECT assignee, priority

Returns only the specified fields as Dictionary<string, object?> rows via Project<T>().

Pagination

Syntax Description
LIMIT 20 OFFSET 40 Skip 40, take 20
PAGE 2 PAGESIZE 25 Page-based (1-indexed)

Pagination can be combined with filters:

status = "open" AND priority >= 3 LIMIT 10 OFFSET 0

Extension Methods

All entry points live in CoreOne.OQuery.Extensions:

Method Returns Description
Apply(query) IQueryable<T> Filter + paginate in one call
ToPredicate<T>(query) Expression<Func<T, bool>> Filter predicate only
Project(query) IEnumerable<Dictionary<string, object?>> Field projection

Extensibility

Custom Operators

public class MyOperators : IOperatorProvider
{
    public bool TryEvaluate(string op, object? left, object? right, out bool result)
    {
        if (op == "like") { result = left?.ToString()?.Contains(right?.ToString() ?? "") ?? false; return true; }
        result = false;
        return false;
    }
}

Custom Functions

public class MyFunctions : IFunctionProvider
{
    public bool TryInvoke(string name, object?[] args, out object? result)
    {
        if (name == "len") { result = args[0]?.ToString()?.Length ?? 0; return true; }
        result = null;
        return false;
    }
}

Register via Providers.Register(new MyOperators(), new MyFunctions()).

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CoreOne.OQuery:

Package Downloads
CoreOne.OQuery.Web

ASP.NET Core integration for CoreOne.OQuery. Provides automatic model binding and DI registration so that OQuery expressions can be bound directly to controller action parameters from the request query string.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 142 5/26/2026