Common.QueryKit
1.0.7
See the version list below for details.
dotnet add package Common.QueryKit --version 1.0.7
NuGet\Install-Package Common.QueryKit -Version 1.0.7
<PackageReference Include="Common.QueryKit" Version="1.0.7" />
<PackageVersion Include="Common.QueryKit" Version="1.0.7" />
<PackageReference Include="Common.QueryKit" />
paket add Common.QueryKit --version 1.0.7
#r "nuget: Common.QueryKit, 1.0.7"
#:package Common.QueryKit@1.0.7
#addin nuget:?package=Common.QueryKit&version=1.0.7
#tool nuget:?package=Common.QueryKit&version=1.0.7
Common.QueryKit
Lightweight • EF Core--safe • Dynamic query composition library
Build powerful, fully SQL-translatable filters, sorts & paging on
IQueryable<T>
Perfect for enterprise ASP.NET Core apps:
ERP systems • School Management • Admin Panels • Reporting APIs
✨ Highlights
- 100% SQL-translatable (no client evaluation)
- Nested properties support (
"Class.GradeLevel","Address.City.Country") - Strongly-typed
FilterOperatorenum - Multi-column sorting with direction control
- Range filtering (
Between),In, null checks - Property whitelisting for security
- Clean & simple pagination
- Explicit Count-safe API
- Minimal footprint, predictable performance
📦 Installation
dotnet add package Common.QueryKit
🚀 Quick Start
var request = new QueryRequest
{
Filters =
[
new() { Property = "FullName", Operator = FilterOperator.Contains, Value = "john" },
new() { Property = "BirthDate", Operator = FilterOperator.Between, From = new DateTime(2000,1,1), To = new DateTime(2010,12,31) },
new() { Property = "Status", Operator = FilterOperator.In, Value = new[] { "Active", "Pending" } }
],
Sorts =
[
new() { Property = "Class.Name" },
new() { Property = "CreatedAt", Descending = true }
],
Page = 1,
PageSize = 25
};
Fetch paged data
var students = await dbContext.Students
.Apply(request)
.ToListAsync();
Fetch total count (safe -- no paging)
var totalCount = await dbContext.Students
.ApplyForCount(request)
.CountAsync();
🔧 Supported Operators
Operator Description
Equals ==
Contains string contains
StartsWith starts with
EndsWith ends with
GreaterThan >
LessThan <
Between value between From ↔ To
In value in collection
Operator Reference Table
| Value | Operator | Description |
|---|---|---|
1 |
Equals |
Exact match (==) |
2 |
Contains |
String contains value |
3 |
StartsWith |
String starts with value |
4 |
EndsWith |
String ends with value |
5 |
GreaterThan |
Greater than (>) |
6 |
LessThan |
Less than (<) |
7 |
Between |
Value between From and To |
8 |
In |
Value exists in collection |
🛡️ Property Whitelisting (Strongly Recommended)
var allowed = new PropertyWhitelist(
"Id", "FullName", "Email", "BirthDate",
"Class.Name", "Class.GradeLevel", "CreatedAt"
);
var students = dbContext.Students
.Apply(request, allowed)
.ToList();
📋 Requirements
- .NET 8.0+
- Entity Framework Core 8.0+
❤️ License
MIT License
Created with ♥ by Muammar Siddiqui • Innovador Solutions
Happy querying! 🚀
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.