A .NET 9 library for dynamic, strongly-typed query building and execution over Entity Framework Core data sources. Supports advanced filtering, projection, and SQL generation.
Install via NuGet Package Manager:
dotnet add package Infragistics.QueryBuilder.Executor
- Dynamic Query Execution: Compose and execute queries at runtime using a flexible object model.
- Advanced Filtering: Nested filters, logical operators (AND/OR), and rich condition support.
- Projection: Select specific fields or project to DTOs.
- SQL Generation: Generate SQL from the query model for diagnostics or analysis.
- ASP.NET Core Integration: Easily expose query endpoints.
In your Startup.cs
or Program configuration:
services.AddQueryBuilder<MyDbContext, MyResultDto>();
app.UseEndpoints(endpoints => { endpoints.UseQueryBuilder<MyDbContext, MyResultDto>("/api/query"); });
{ "Entity": "Users", "ReturnFields": ["Id", "Name"], "Operator": "And", "FilteringOperands": [ { "FieldName": "IsActive", "Condition": { "Name": "equals" }, "SearchVal": true } ] }
var sql = SqlGenerator.GenerateSql(query);
- Query: Describes the entity, fields, logical operator, and filters.
- QueryFilter: Represents a filter or group of filters.
- QueryFilterCondition: Specifies the comparison type (e.g., equals, contains).
- .NET 9
- Microsoft.EntityFrameworkCore
- AutoMapper
This package is provided as-is for public and demonstration use.
For more details, see the source code or contact the maintainers.