Chandrashekhar.DynamicSeachEngine 1.0.0

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

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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