Go to file
2019-04-22 20:18:38 -05:00
PoweredSoft.DynamicQuery fix in the order of sortings when grouping is activated. 2019-04-22 20:18:38 -05:00
PoweredSoft.DynamicQuery.AspNetCore ready for version 2 2019-03-22 15:27:04 -05:00
PoweredSoft.DynamicQuery.Cli multi group fix. 2018-11-15 19:42:30 -06:00
PoweredSoft.DynamicQuery.Core getting documentations ready. 2019-03-22 16:09:44 -05:00
PoweredSoft.DynamicQuery.Test fix in the order of sortings when grouping is activated. 2019-04-22 20:18:38 -05: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 will be nuggetting using alm from now on. 2019-02-13 22:37:46 -06:00
LICENSE.md Create LICENSE.md 2018-10-21 16:14:57 -05:00
README.md I beleive its ready now. 2019-03-22 16:17:19 -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

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.

How to configure during startup

using PoweredSoft.DynamicQuery.AspNetCore;

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

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