diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8aaa98fc..2a4d9c8a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,10 +9,10 @@ ] }, "dotnet-format": { - "version": "5.1.250801", + "version": "8.0.452407", "commands": [ "dotnet-format" ] } } -} +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index a5ccd60b..f3f73104 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ node_modules .temp .cache docs/.vuepress/dist +/*.user diff --git a/.husky/task-runner.json b/.husky/task-runner.json index 21250b88..a5d520a9 100644 --- a/.husky/task-runner.json +++ b/.husky/task-runner.json @@ -4,8 +4,8 @@ "command": "dotnet", "group": "pre-commit", "args": [ - "dotnet-format", - "--include", + "format", + "--include=", "${staged}" ], "include": [ diff --git a/README.md b/README.md index a52032d1..1af9b0c3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Gridify (A Modern Dynamic LINQ library) -![GitHub](https://img.shields.io/github/license/alirezanet/gridify) -![Nuget](https://img.shields.io/nuget/dt/gridify?color=%239100ff) +![GitHub](https://img.shields.io/github/license/alirezanet/gridify) +![Nuget](https://img.shields.io/nuget/dt/gridify?color=%239100ff) ![Nuget](https://img.shields.io/nuget/v/gridify?label=stable) ![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/gridify?label=latest) [![NuGet version (Gridify)](https://img.shields.io/nuget/v/Gridify.svg?style=flat-square)](https://www.nuget.org/packages/Gridify/) @@ -29,6 +29,7 @@ Gridify is a dynamic LINQ library that simplifies the process of converting stri - Compatible with ORMs, especially Entity Framework - Can be used on every collection that LINQ supports - Compatible with object-mappers like AutoMapper +- Compatible with Elasticsearch ## Documentation diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 7d8a2ee2..68303018 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -2,6 +2,7 @@ import { defineUserConfig } from 'vuepress-vite' import type { DefaultThemeOptions } from 'vuepress-vite' import type { ViteBundlerOptions } from '@vuepress/bundler-vite' import { plugin, themeConfig, head } from './configs' +import markdownItInclude from 'markdown-it-include' export default defineUserConfig({ lang: 'en-US', @@ -13,4 +14,7 @@ export default defineUserConfig({ port: 3000, base: '/Gridify/', head: head, + extendsMarkdown: (md) => { + md.use(markdownItInclude); + } }) diff --git a/docs/.vuepress/configs/navbar.ts b/docs/.vuepress/configs/navbar.ts index b8c1eef5..d30bc94e 100644 --- a/docs/.vuepress/configs/navbar.ts +++ b/docs/.vuepress/configs/navbar.ts @@ -7,7 +7,18 @@ export const navbar: NavbarConfig = [ }, { text: 'Guide', - link: '/guide/', + children: [ + { + text: 'LINQ / Entity Framework', + link: '/guide/', + activeMatch: '^((?!\/guide\/elasticsearch).)*$', + }, + { + text: 'Elasticsearch', + link: '/guide/elasticsearch/', + activeMatch: '^\/guide\/elasticsearch\/*.*$', + } + ], }, { text: 'Examples', diff --git a/docs/.vuepress/configs/sidebar.ts b/docs/.vuepress/configs/sidebar.ts index 0708d95d..823895c4 100644 --- a/docs/.vuepress/configs/sidebar.ts +++ b/docs/.vuepress/configs/sidebar.ts @@ -36,6 +36,38 @@ export const sidebar: SidebarConfig = { ] } ], + '/guide/elasticsearch/': [ + { + text: 'Introduction', + children: [ + '/guide/elasticsearch/README.md', + '/guide/elasticsearch/getting-started.md', + '/guide/elasticsearch/extensions.md', + ], + }, + { + text: 'Configuration', + children: [ + '/guide/elasticsearch/gridifyQuery.md', + '/guide/elasticsearch/gridifyMapper.md', + '/guide/elasticsearch/gridifyGlobalConfiguration.md', + ] + }, + { + text: 'Syntax', + children: [ + '/guide/elasticsearch/filtering.md', + '/guide/elasticsearch/ordering.md', + ] + }, + { + text: 'Advanced', + children: [ + '/guide/elasticsearch/dependency-injection.md', + '/guide/elasticsearch/elasticsearch.md', + ] + } + ], '/contribution/': [ { text: 'Contribution', diff --git a/docs/README.md b/docs/README.md index 9ce1e41d..cd13f00e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -17,6 +17,6 @@ features: - title: Exceptional Performance details: Gridify has been designed with performance in mind and can outperform other dynamic LINQ libraries. - title: Compatibility - details: Gridify can be used in any .NET Core or .NET Framework project, making it highly compatible. It can also be used alongside Entity Framework and other ORMs. + details: Gridify can be used in any .NET Core or .NET Framework project, making it highly compatible. It can also be used alongside Entity Framework and other ORMs. Gridify.Elasticsearch extension provides and ability to build Elasticsearch DSL queries from Gridify filters. footer: MIT Licensed | © 2021-present AliReZa Sabouri --- diff --git a/docs/contribution/README.md b/docs/contribution/README.md index a762f3ac..ba0426ed 100644 --- a/docs/contribution/README.md +++ b/docs/contribution/README.md @@ -46,4 +46,5 @@ check out the [github contributing guide](https://git-scm.com/book/en/v2/GitHub- - [Alireza Arabshahi](https://github.com/AlirezaArabshahi) - [sunyuliang](https://github.com/sunyuliang) - [TSrgy](https://github.com/TSrgy) +- [Dzmitry Koush](https://github.com/ne4ta) - Add your name diff --git a/docs/guide/README.md b/docs/guide/README.md index 5fc609e4..71c85fec 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -1,6 +1,10 @@ # Introduction -Gridify is a dynamic LINQ library that simplifies the process of converting strings to LINQ queries. With exceptional performance and ease-of-use, Gridify makes it effortless to apply filtering, sorting, and pagination using text-based data. +Gridify is a dynamic LINQ library that simplifies the process of converting strings to LINQ queries. With exceptional +performance and ease-of-use, Gridify makes it effortless to apply filtering, sorting, and pagination using text-based +data. + +Gridify.Elasticsearch is an extension of Gridify, that provides an ability to generate Elasticsearch DSL queries. Read more about Gridify.Elasticsearch in [a separate thread of the documentation](./elasticsearch/). ## Features @@ -16,7 +20,6 @@ Gridify is a dynamic LINQ library that simplifies the process of converting stri - Can be used on every collection that LINQ supports - Compatible with object-mappers like AutoMapper - ## Examples To better illustrate how Gridify works, we've prepared a few examples: @@ -24,13 +27,13 @@ To better illustrate how Gridify works, we've prepared a few examples: - [Using Gridify in API Controllers](../example/api-controller.md) - Coming soon ... - ## Performance -Filtering can be the most expensive feature in Gridify. The following benchmark compares filtering in the most well-known dynamic LINQ libraries. As you can see, Gridify has the closest result to native LINQ: +Filtering can be the most expensive feature in Gridify. The following benchmark compares filtering in the most +well-known dynamic LINQ libraries. As you can see, Gridify has the closest result to native LINQ: -| Method | Mean | Error | StdDev | RatioSD | Allocated | Alloc Ratio | -|----------------- |-------------:|------------:|------------:|--------:|------------:|------------:| +| Method | Mean | Error | StdDev | RatioSD | Allocated | Alloc Ratio | +|------------------|-------------:|------------:|------------:|--------:|------------:|------------:| | Native LINQ | 651.2 us | 6.89 us | 6.45 us | 0.00 | 32.74 KB | 1.00 | | Gridify | 689.1 us | 10.70 us | 11.45 us | 0.02 | 36.85 KB | 1.13 | | DynamicLinq | 829.3 us | 10.98 us | 9.17 us | 0.01 | 119.29 KB | 3.64 | @@ -42,13 +45,13 @@ Filtering can be the most expensive feature in Gridify. The following benchmark BenchmarkDotNet v0.13.8, Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2) 12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores .NET SDK 8.0.100-preview.1.23115.2 - [Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 +[Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 +DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 -This Benchmark is available [Here](https://github.com/alirezanet/Gridify/blob/master/benchmark/LibraryComparisionFilteringBenchmark.cs) +This Benchmark is +available [Here](https://github.com/alirezanet/Gridify/blob/master/benchmark/LibraryComparisionFilteringBenchmark.cs) ::: -