Skip to content

Commit

Permalink
add GridifyGlobalConfiguration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezanet committed Dec 15, 2021
1 parent da0642c commit 1345afb
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/.vuepress/configs/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const sidebar: SidebarConfig = {
children: [
'/guide/gridifyQuery.md',
'/guide/gridifyMapper.md',
'/guide/gridifyGlobalConfiguration.md',
]
},
{
Expand Down
11 changes: 8 additions & 3 deletions docs/guide/entity-framework.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# 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();
```

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';

Expand Down
58 changes: 58 additions & 0 deletions docs/guide/gridifyGlobalConfiguration.md
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit 1345afb

Please sign in to comment.