From 1345afb866fa09944659adf8a8f2374ccc0dbf3a Mon Sep 17 00:00:00 2001 From: AliReZa Sabouri <7004080+alirezanet@users.noreply.github.com> Date: Wed, 15 Dec 2021 16:34:28 +0330 Subject: [PATCH] add GridifyGlobalConfiguration docs --- docs/.vuepress/configs/sidebar.ts | 1 + docs/guide/entity-framework.md | 11 +++-- docs/guide/gridifyGlobalConfiguration.md | 58 ++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 docs/guide/gridifyGlobalConfiguration.md diff --git a/docs/.vuepress/configs/sidebar.ts b/docs/.vuepress/configs/sidebar.ts index 42573614..418b25fc 100644 --- a/docs/.vuepress/configs/sidebar.ts +++ b/docs/.vuepress/configs/sidebar.ts @@ -16,6 +16,7 @@ export const sidebar: SidebarConfig = { children: [ '/guide/gridifyQuery.md', '/guide/gridifyMapper.md', + '/guide/gridifyGlobalConfiguration.md', ] }, { diff --git a/docs/guide/entity-framework.md b/docs/guide/entity-framework.md index 1e40e24c..18253eb1 100644 --- a/docs/guide/entity-framework.md +++ b/docs/guide/entity-framework.md @@ -1,9 +1,12 @@ # Entity Framework +## Gridify.EntityFramework Package + The `Gridify.EntityFramework` package has two additional `GridifyAsync()` and `GridifyQueryableAsync()` methods. -## Enableing compatibility layer -If you want to use gridify with Entity Framework, you should enable the compatibility layer. +## Compatibility layer + +If you want to use gridify with Entity Framework, you should enable the compatibility layer: ``` csharp GridifyGlobalConfiguration.EnableEntityFrameworkCompatibilityLayer(); @@ -11,9 +14,11 @@ GridifyGlobalConfiguration.EnableEntityFrameworkCompatibilityLayer(); Enabling the compatibility layer provides the following features: -- EF ServiceProviderCaching support +- It tweaks the internal expression builder to make it compatible with Entity Framework. - EF query optimization +- EF ServiceProviderCaching support - Creates parameterized queries + ``` sql DECLARE @__Value_0 nvarchar(4000) = N'vahid'; diff --git a/docs/guide/gridifyGlobalConfiguration.md b/docs/guide/gridifyGlobalConfiguration.md new file mode 100644 index 00000000..39e32a59 --- /dev/null +++ b/docs/guide/gridifyGlobalConfiguration.md @@ -0,0 +1,58 @@ +# GridifyGlobalConfiguration + +Using this class you can change the default behavior and configuration of the gridify library. + +## Properties + +### DefaultPageSize + +The default page size for the paging methods when no page size is specified. + +- type: `int` +- default: `20` + +### CaseSensitiveMapper + +By default mappings are case insensitive. for example, `name=John` and `Name=John` are considered equal. +You can change this behavior by setting this property to `true`. + +- type: `bool` +- default: `false` +- related to: [GridifyMapper - CaseSensitive](./gridifyMapper.md#casesensitive) + +### AllowNullSearch + +This option enables the 'null' keyword in filtering operations, for example, `name=null` searches for all records with a null value for the `name` field not the string `"null"`. if you need to search for the string `"null"` you can + +- type: `bool` +- default: `true` +- related to: [GridifyMapper - AllowNullSearch](./gridifyMapper.md#allownullsearch) + +### IgnoreNotMappedFields + +If true, in filtering and ordering operations, gridify doesn't return any exceptions when a mapping is not defined for the given field. + +- type: `bool` +- default: `false` +- related to: [GridifyMapper - IgnoreNotMappedFields](./gridifyMapper.md#ignorenotmappedfields) + +### EntityFrameworkCompatibilityLayer + +Setting this property to `true` Enables the EntityFramework Compatibility layer to make the generated expressions compatible whit entity framework. + +- type: `bool` +- default: `false` + +::: tip +Lean more about the [compatibility layer](./entity-framework.md#compatibility-layer) +::: + +## Methods + +### EnableEntityFrameworkCompatibilityLayer() + +Simply sets the [EntityFrameworkCompatibilityLayer](#entityframeworkcompatibilitylayer) property to `true`. + +### DisableEntityFrameworkCompatibilityLayer() + +Simply sets the [EntityFrameworkCompatibilityLayer](#entityframeworkcompatibilitylayer) property to `false`.