Gridify 2.0.0-beta.2

This is a prerelease version of Gridify.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Gridify --version 2.0.0-beta.2
NuGet\Install-Package Gridify -Version 2.0.0-beta.2
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="Gridify" Version="2.0.0-beta.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Gridify --version 2.0.0-beta.2
#r "nuget: Gridify, 2.0.0-beta.2"
#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.
// Install Gridify as a Cake Addin
#addin nuget:?package=Gridify&version=2.0.0-beta.2&prerelease

// Install Gridify as a Cake Tool
#tool nuget:?package=Gridify&version=2.0.0-beta.2&prerelease

Gridify

Nuget Nuget Nuget (with prereleases) GitHub branch checks state

Easy and optimized way to apply Filtering, Sorting and pagination using text-based data.

The best use case of this library is Asp-net APIs. When you need to get some string base filtering conditions to filter data or sort it by a field name or apply pagination concepts to your lists and return a pageable, data grid ready information, from any repository or database.

Performance comparison

Filtering is the most expensive feature in gridify. the following benchmark is comparing filtering in the most known dynamic linq libraries. As you can see, gridify has the closest result to the native linq. Also, i Should note other features like Pagination and Sorting have almost zero overhead in Gridify.

BenchmarkDotNet=v0.13.0, OS=Windows 10.0.19043.1165 (21H1/May2021Update) 11th Gen Intel Core i5-11400F 2.60GHz, 1 CPU, 12 logical and 6 physical cores .NET SDK=5.0.301 [Host] : .NET 5.0.7 (5.0.721.25508), X64 RyuJIT DefaultJob : .NET 5.0.7 (5.0.721.25508), X64 RyuJIT

Method Mean Error StdDev Ratio RatioSD Gen 0 Gen 1 Allocated
Native Linq 737.0 us 4.95 us 4.39 us 1.00 0.00 5.8594 2.9297 36 KB
Gridify 774.5 us 13.60 us 12.72 us 1.05 0.02 6.8359 2.9297 46 KB
DynamicLinq 902.7 us 16.33 us 15.28 us 1.22 0.02 19.5313 9.7656 122 KB
Sieve 982.3 us 11.06 us 10.35 us 1.33 0.01 8.7891 3.9063 54 KB
Fop 2,954.8 us 14.16 us 12.55 us 4.01 0.03 50.7813 23.4375 311 KB

WebApi Simple Usage example

// ApiController

[Produces(typeof(Paging<Person>))]
public IActionResult GetPersons([FromQuery] GridifyQuery gQuery)
{
    // Gridify => Filter,Sort & Apply Paging 
    // in short, Gridify returns data especially for data Grids. 
    return myDbContext.Persons.Gridify(gQuery);
}

complete request sample:

http://exampleDomain.com/api/GetPersons?pageSize=100&page=1&orderBy=FirstName&filter=Age%3D%3D10

Also, we can totally ignore GridifyQuery

http://exampleDomain.com/api/GetPersons

What is GridifyQuery (basic usage example)

GridifyQuery is a simple class for configuring Filtering,Paging,Sorting.

// usually, we don't need to create this object manually
// for example, we get this object as a parameter from our API Controller
var gQuery = new GridifyQuery()
{
    Filter = "FirstName=John",
    Page = 1,
    PageSize = 20,
    OrderBy = "LastName"
};

Paging<Person> pData =
         myDbContext.Persons  // we can use Any list or repository or EntityFramework context
          .Gridify(gQuery); // Filter,Sort & Apply Paging


// pData.Count => Count persons with 'John', First name
// pData.Data      => First 20 Persons with 'John', First Name

ApplyFiltering

Also, if you don't need paging and sorting features simply use ApplyFiltering extension instead of Gridify.

var query = myDbContext.Persons.ApplyFiltering("name = John");
// this is equal to : 
// myDbContext.Persons.Where(p => p.Name == "John");

see more examples in the tests

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on Gridify:

Package Downloads
Gridify.EntityFramework

Gridify (EntityFramework), Easy and optimized way to apply Filtering, Sorting, and Pagination using text-based data.

DataExplorer

Library featuring an opinionated, reusable data access layer offering abstractions and implementations for SQL storages (EF Core).

KoloDev.GDS.UI

Kolo GDS UI Accelerator

NiuX.Common

csharp common, utils, helpers, tools etc.

TIA.Core.Util

TIA.Core.Util

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.14.1 52,744 12/4/2023
2.14.0 5,417 11/18/2023
2.13.1 1,514 11/12/2023
2.13.0 205 11/11/2023
2.12.0 4,233 10/27/2023
2.11.1 18,781 10/6/2023
2.11.0 148 10/5/2023
2.10.1 3,622 9/28/2023
2.10.0 2,093 9/20/2023
2.10.0-Preview1 90 9/19/2023
2.9.2 2,235 9/15/2023
2.9.1 8,931 8/22/2023
2.9.0 1,789 8/18/2023
2.8.4 60,467 4/18/2023
2.8.3 22,988 3/4/2023
2.8.2 43,563 12/7/2022
2.8.1 105,443 10/7/2022
2.8.0 10,098 7/22/2022
2.7.5 24,772 6/6/2022
2.7.4 22,455 4/22/2022
2.7.3 9,488 4/13/2022
2.7.2 1,014 4/12/2022
2.7.1 7,696 3/2/2022
2.7.0 732 3/1/2022
2.6.0 16,532 1/14/2022
2.5.0 4,300 12/27/2021
2.4.8 4,220 12/15/2021
2.4.7 386 12/14/2021
2.4.6 412 12/10/2021
2.4.5 585 12/5/2021
2.4.5-alpha5 184 12/5/2021
2.4.5-alpha4 186 12/5/2021
2.4.5-alpha3 151 12/2/2021
2.4.5-alpha1 158 12/2/2021
2.4.4 20,372 11/20/2021
2.4.3 800 11/19/2021
2.4.2 829 11/19/2021
2.4.1 1,157 11/18/2021
2.4.0 480 11/18/2021
2.3.3 537 11/16/2021
2.3.2 954 11/1/2021
2.3.1 1,303 10/19/2021
2.3.0 4,752 10/4/2021
2.2.1 463 9/30/2021
2.2.0 480 9/28/2021
2.1.0 4,105 9/21/2021
2.0.0 442 9/18/2021
2.0.0-beta.3 144 9/17/2021
2.0.0-beta.2 141 9/16/2021
2.0.0-beta.1 190 9/15/2021
2.0.0-alpha.1 185 8/12/2021
1.4.2 8,011 8/8/2021
1.4.1 560 8/4/2021
1.4.0 490 8/4/2021
1.3.5 545 7/28/2021
1.3.4 2,133 7/16/2021
1.3.3 647 7/1/2021
1.3.2 638 6/30/2021
1.3.1 631 6/23/2021
1.1.2 1,556 4/16/2021
1.1.1 584 4/16/2021
1.1.0 1,645 9/17/2020
1.0.5 7,337 7/3/2020
1.0.3 789 7/2/2020
1.0.2 918 7/2/2020
1.0.1 945 7/2/2020
1.0.0 1,122 7/1/2020