Go to file
2019-12-12 17:37:32 -06:00
PoweredSoft.DynamicQuery Resolve Query Interceptor and queryable Interceptor provider :) 2019-12-12 17:37:32 -06:00
PoweredSoft.DynamicQuery.AspNetCore json net support is ready, waiting on ms for support of json converter from interfaces. 2019-10-13 15:15:07 -05:00
PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson json net support is ready, waiting on ms for support of json converter from interfaces. 2019-10-13 15:15:07 -05:00
PoweredSoft.DynamicQuery.Cli Resolve Query Interceptor and queryable Interceptor provider :) 2019-12-12 17:37:32 -06:00
PoweredSoft.DynamicQuery.Core Resolve Query Interceptor and queryable Interceptor provider :) 2019-12-12 17:37:32 -06:00
PoweredSoft.DynamicQuery.NewtonsoftJson json net support is ready, waiting on ms for support of json converter from interfaces. 2019-10-13 15:15:07 -05:00
PoweredSoft.DynamicQuery.System.Text.Json json net support is ready, waiting on ms for support of json converter from interfaces. 2019-10-13 15:15:07 -05:00
PoweredSoft.DynamicQuery.Test Resolve Query Interceptor and queryable Interceptor provider :) 2019-12-12 17:37:32 -06:00
.gitattributes Add .gitignore and .gitattributes. 2018-10-17 18:30:53 -05:00
.gitignore Add .gitignore and .gitattributes. 2018-10-17 18:30:53 -05:00
DynamicQuery.sln json net support is ready, waiting on ms for support of json converter from interfaces. 2019-10-13 15:15:07 -05:00
LICENSE.md Create LICENSE.md 2018-10-21 16:14:57 -05:00
README.md updated docs. 2019-10-13 16:37:32 -05:00

Dynamic Query

It's a library that allows you to easily query a queryable using a criteria object.

It also offers, to intercept the query using IQueryInterceptor implementations.

Breaking Changes

If you are moving up from v1, the breaking changes details are lower.

Getting Started

Install nuget package to your awesome project.

Full Version NuGet NuGet Install
PoweredSoft.DynamicQuery NuGet PM> Install-Package PoweredSoft.DynamicQuery
PoweredSoft.DynamicQuery.Core NuGet PM> Install-Package PoweredSoft.DynamicQuery.Core
PoweredSoft.DynamicQuery.AspNetCore NuGet PM> Install-Package PoweredSoft.DynamicQuery.AspNetCore
PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson NuGet PM> Install-Package PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson

Using in ASP.NET Core

The package Asp.net core of dynamic query will help you start to use Dynamic Query faster in your web project.

For NET CORE 2.x look at v2.0 branch.

How to configure during startup (NET Core 3)

using PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services
            .AddMvc()
            .AddPoweredSoftJsonNetDynamicQuery();
    }
}

How to use in a controller


[HttpGet]
public IQueryExecutionResult<OfSomething> Get(
            [FromServices]YourContext context, 
            [FromServices]IQueryHandler handler, 
            [FromServices]IQueryCriteria criteria,
            int? page = null,
            int? pageSize = null)
{
    criteria.Page = page;
    criteria.PageSize = pageSize;
    IQueryable<OfSomething> query = context.Somethings;
    var result = handler.Execute(query, criteria);
    return result;
}

[HttpPost]
public IQueryExecutionResult<OfSomething> Read(
    [FromServices]YourContext context, 
    [FromServices]IQueryHandler handler,
    [FromBody]IQueryCriteria criteria)
{
    IQueryable<OfSomething> query = context.Somethings;
    var result = handler.Execute(query, criteria);
    return result;
}

New support for async

[HttpPost]
public async Task<IQueryExecutionResult<OfSomething>> Read(
    [FromServices]YourContext context, 
    [FromServices]IQueryHandlerAsync handler,
    [FromBody]IQueryCriteria criteria)
{
    IQueryable<OfSomething> query = context.Somethings;
    var result = await handler.ExecuteAsync(query, criteria);
    return result;
}

Sample Web Project - ASP.NET CORE + EF Core

Visit: https://github.com/PoweredSoft/DynamicQueryAspNetCoreSample

Breaking Changes if you are migrating from 1.x

Response interface, is now generic IQueryResult<T> which impacts the way to execute the handler.

Grouping results

Since the results are now generic, it's no longer a List