Chandrashekhar.DynamicSeachEngine
1.0.0
dotnet add package Chandrashekhar.DynamicSeachEngine --version 1.0.0
NuGet\Install-Package Chandrashekhar.DynamicSeachEngine -Version 1.0.0
<PackageReference Include="Chandrashekhar.DynamicSeachEngine" Version="1.0.0" />
<PackageVersion Include="Chandrashekhar.DynamicSeachEngine" Version="1.0.0" />
<PackageReference Include="Chandrashekhar.DynamicSeachEngine" />
paket add Chandrashekhar.DynamicSeachEngine --version 1.0.0
#r "nuget: Chandrashekhar.DynamicSeachEngine, 1.0.0"
#:package Chandrashekhar.DynamicSeachEngine@1.0.0
#addin nuget:?package=Chandrashekhar.DynamicSeachEngine&version=1.0.0
#tool nuget:?package=Chandrashekhar.DynamicSeachEngine&version=1.0.0
Dynamic Filtering, Sorting & Pagination (.NET)
This project demonstrates how to implement:
- Dynamic Filtering (AND / OR / Nested)
- Sorting
- Pagination
- Expression Tree based LINQ queries
- Generic and reusable backend architecture
It is designed as a foundation which can be directly integrated into a Web API project.
🎯 Why This Project Was Built
In real-world applications (Admin panels, dashboards, grids):
Frontend often needs to send:
- Multiple filters
- Nested filters
- OR / AND conditions
- Sorting
- Pagination
Without this approach:
- Developers end up writing multiple APIs
- Code becomes tightly coupled
- Logic becomes hardcoded
- Maintenance becomes difficult
This project solves that by building:
👉 One generic dynamic filtering engine
🧠 Problem It Solves
Typical API approach:
/employees/byName/employees/byDepartment/employees/bySalary/employees/byAge
This is not scalable.
Instead, this project enables:
POST /employees/search
Frontend sends JSON → backend builds LINQ dynamically → DB queried efficiently.
🏗 What is Implemented
1. Dynamic Filtering Engine
Supports:
- Field-based filters
- AND logic
- OR logic
- Nested logical groups
Operators:
- equals
- neq
- contains
- startsWith
- gt
- gte
- lt
- lte
- between
Built using:
- Expression Trees
- LINQ
- Generic methods
2. Sorting
Dynamic sorting based on:
- sortBy
- sortDirection (asc/desc)
3. Pagination
Reusable extension method:
GetPaged<T>(IQueryable<T> query, int pageNumber, int pageSize)
---
# 📦 Example JSON Requests
## Basic Pagination + Sorting
{ "page": 1, "pageSize": 20, "sortBy": "Salary", "sortDirection":
"desc", "filters": \[\] }
------------------------------------------------------------------------
## Name starts with A
{ "page": 1, "pageSize": 15, "sortBy": "Name", "sortDirection": "asc",
"filters": \[ { "field": "Name", "operator": "startsWith", "value": "A"
} \] }
------------------------------------------------------------------------
## Name starts A OR contains R
{ "page": 1, "pageSize": 10, "sortBy": "Age", "sortDirection": "desc",
"filters": \[ { "logic": "OR", "filters": \[ { "field": "Name",
"operator": "startsWith", "value": "A" }, { "field": "Name", "operator":
"contains", "value": "R" } \] } \] }
------------------------------------------------------------------------
| Product | Versions 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 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. |
-
net8.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.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 162 | 2/14/2026 |