Skip to content

Commit ce72861

Browse files
committed
docs: improve clarity and consistency across multiple guide documents
1 parent 483f1fd commit ce72861

17 files changed

+96
-106
lines changed

docs/pages/example/api-controller.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Using Gridify in API Controllers
22

3-
When working with ASP.NET APIs, especially when you need to apply string-based filtering conditions, sorting based on field names, or implementing pagination functionality, the Gridify library is a valuable tool. It can be used in any .NET project and with any type of collection, not just limited to ASP.NET projects.
3+
When working with ASP.NET APIs, especially when you need to apply string-based filtering, sorting by field names, or implementing pagination, the Gridify library is a valuable tool. It can be used in any .NET project and with any type of collection, not just limited to ASP.NET projects.
44

5-
To demonstrate the core concepts of Gridify, let's look at a simple implementation in the following example.
5+
Let's look at a simple implementation to demonstrate the core concepts of Gridify.
66

77
## Describing the Scenario
88

docs/pages/guide/autoMapper.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ QueryablePaging<Person> qp = personRepo.GridifyQueryable(gridifyQuery);
1414
var result = new Paging<Person>(qp.Count, qp.Query.ProjectTo<PersonDTO>().ToList());
1515
```
1616

17-
## GridifyTo!
17+
## GridifyTo Extension
1818

19-
Filtering, Ordering, Paging, and Projection are all done with `GridifyTo`.
19+
Filtering, ordering, paging, and projection are all done with a `GridifyTo` extension method.
2020

21-
Gridify library does not have a built-in `GridifyTo` extension method because we don't want to have AutoMapper dependency. but if you are using AutoMapper in your project, I recommend you to add the bellow extension method to your project.
21+
The Gridify library does not include a built-in `GridifyTo` extension method because we don't want to add an AutoMapper dependency. However, if you are using AutoMapper in your project, we recommend adding the following extension method:
2222

2323
``` csharp
2424
public static Paging<TDestination> GridifyTo<TSource, TDestination>(

docs/pages/guide/compile.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Compile and Reuse
22

3-
You can access Gridify generated expressions using the `GetFilteringExpression` of [GridifyQuery](./gridifyQuery.md)
4-
or `BuildCompiled` methods of [QueryBuilder](./queryBuilder.md) class,
5-
by storing an expression you can use it multiple times without having any overheads,
6-
also if you store a compiled expression you get a massive performance boost.
3+
You can access Gridify-generated expressions using the `GetFilteringExpression` method of [GridifyQuery](./gridifyQuery.md)
4+
or the `BuildCompiled` method of the [QueryBuilder](./queryBuilder.md) class.
5+
By storing an expression, you can reuse it multiple times without any overhead.
6+
If you store a compiled expression, you get a massive performance boost.
77

88
::: warning
9-
You should only use a **compiled** expression (delegate) if you are **not** using Gridify alongside an ORM like
10-
Entity-Framework.
9+
You should only use a **compiled** expression (delegate) if you are **not** using Gridify with an ORM like
10+
Entity Framework.
1111
:::
1212

1313
``` csharp

docs/pages/guide/dependency-injection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Dependency Injection
22

3-
Gridify offers a powerful feature that enables you to streamline data mapping and configurations in your application by integrating with the Dependency Injection (DI) container. By registering your mapping profiles with DI, you can achieve cleaner, more maintainable code and improved separation of concerns. This section provides an overview of how to register your GridifyMapper configurations with DI.
3+
Gridify offers a powerful feature that enables you to streamline data mapping and configuration in your application by integrating with the Dependency Injection (DI) container. By registering your mapping profiles with DI, you can achieve cleaner, more maintainable code and improved separation of concerns. This section provides an overview of how to register your GridifyMapper configurations in the DI container.
44

55
## Register GridifyMapper with DI
66

7-
Registering Gridify mapping with DI is a straightforward process. You'll define mapping profiles for your models and then register them in the DI container. Follow these steps to get started:
7+
Registering Gridify mappings with DI is straightforward. Define mapping profiles for your models, then register them in the DI container. Follow these steps to get started:
88

99
## 1. Define Mapping Profiles
1010

docs/pages/guide/extensions.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
# Extensions
22

3-
The Gridify library adds the below extension methods to `IQueryable` objects.
3+
The Gridify library adds the following extension methods to `IQueryable` objects.
44

5-
All Gridify extension methods can accept [GridifyQuery](./gridifyQuery.md) and [GridifyMapper](./gridifyMapper.md) as a parameter.
6-
Make sure to check out the documentation of these classes for more information.
5+
All Gridify extension methods can accept [GridifyQuery](./gridifyQuery.md) and [GridifyMapper](./gridifyMapper.md) as parameters.
6+
Make sure to check out the documentation for these classes for more information.
77

88
::: tip
9-
If you want to use Gridify extension methods on an `IEnumerable` object, use `.AsQueryable()` first.
9+
To use Gridify extension methods on an `IEnumerable` object, first call `.AsQueryable()` on it.
1010
:::
1111

1212
## ApplyFiltering
1313

14-
You can use this method if you want to only apply **filtering** on an `IQueriable` or `DbSet`.
14+
Use this method to apply **filtering** to an `IQueryable` or `DbSet`.
1515

1616
``` csharp
1717
var query = personsRepo.ApplyFiltering("name = John");
1818
```
1919

20-
this is completely equivalent to the below LINQ query:
20+
This is equivalent to the following LINQ query:
2121

2222
``` csharp
2323
var query = personsRepo.Where(p => p.Name == "John");
2424
```
2525

26-
In the `ApplyFiltering` method, we can use a raw string to filter the data, which can be generated dynamically or passed by the end-user for example through an API client or console input, but using the Linq `Where` method, we always have to hard code the query for the supported fields.
26+
With the `ApplyFiltering` method, you can use a raw string to filter data. This string can be generated dynamically or passed by the end-user (for example, through an API client or console input). In contrast, when using the LINQ `Where` method, you must hard-code the query for the supported fields.
2727

2828
Check out the [Filtering Operators](./filtering.md) section for more information.
2929

3030
## ApplyOrdering
3131

32-
You can use this method if you want to only apply **ordering** on an `IQueriable` collection or `DbSet`.
32+
Use this method to apply **ordering** to an `IQueryable` collection or `DbSet`.
3333

3434
``` csharp
3535
var query = personsRepo.ApplyOrdering("name, age desc");
3636
```
3737

38-
this is completely equivalent to the below LINQ query:
38+
This is equivalent to the following LINQ query:
3939

4040
``` csharp
4141
var query = personsRepo.OrderBy(x => x.Name).ThenByDescending(x => x.Age);
@@ -45,35 +45,35 @@ Check out the [Ordering](./ordering.md) section for more information.
4545

4646
## ApplyPaging
4747

48-
You can use this method if you want to only apply **paging** on an `IQueryable` collection or `DbSet`.
48+
Use this method to apply **paging** to an `IQueryable` collection or `DbSet`.
4949

5050
``` csharp
5151
var query = personsRepo.ApplyPaging(3, 20);
5252
```
5353

54-
this is completely equivalent to the below LINQ query:
54+
This is equivalent to the following LINQ query:
5555

5656
``` csharp
5757
var query = personsRepo.Skip((3-1) * 20).Take(20);
5858
```
5959

6060
## ApplyFilteringAndOrdering
6161

62-
You can use this method if you want to apply **filtering** and **ordering** on an `IQueryable` collection or `DbSet`. This method accepts `IGridifyQuery`.
62+
Use this method to apply **filtering** and **ordering** to an `IQueryable` collection or `DbSet`. This method accepts `IGridifyQuery`.
6363

6464
## ApplyOrderingAndPaging
6565

66-
You can use this method if you want to apply **ordering** and **paging** on an `IQueryable` collection or `DbSet`. This method accepts `IGridifyQuery`.
66+
Use this method to apply **ordering** and **paging** to an `IQueryable` collection or `DbSet`. This method accepts `IGridifyQuery`.
6767

6868
## ApplyFilteringOrderingPaging
6969

70-
You can use this method if you want to apply **filtering** and **ordering** and **paging** on an `IQueryable` collection or `DbSet`. This method accepts `IGridifyQuery`.
70+
Use this method to apply **filtering**, **ordering**, and **paging** to an `IQueryable` collection or `DbSet`. This method accepts `IGridifyQuery`.
7171

7272
## GridifyQueryable
7373

74-
Like [ApplyFilteringOrderingPaging](#ApplyFilteringOrderingPaging) but it returns a `QueryablePaging<T>` that has an extra `int Count` value that can be used for pagination.
74+
Like [ApplyFilteringOrderingPaging](#applyfilteringorderingpaging), but it returns a `QueryablePaging<T>` that includes an extra `int Count` value for pagination.
7575

7676
## Gridify
7777

78-
This is an ALL-IN-ONE package, it accepts `IGridifyQuery`, applies filtering, ordering, and paging, and returns a `Paging<T>` object.
79-
This method is completely optimized to be used with any **Grid** component.
78+
This is an all-in-one method. It accepts `IGridifyQuery`, applies filtering, ordering, and paging, and returns a `Paging<T>` object.
79+
This method is optimized for use with any grid component.

docs/pages/guide/extensions/elasticsearch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Elasticsearch
22

3-
Gridify.Elasticsearch is an extension of Gridify, that provides an ability to generate Elasticsearch DSL queries.
3+
Gridify.Elasticsearch is an extension of Gridify that provides the ability to generate Elasticsearch DSL queries.
44

55
## Gridify.Elasticsearch Package
66

7-
The `Gridify.Elasticsearch` package has a bunch of extension methods that allow to convert Gridify filters and sortings to Elasticsearch DSL queries using Elastic.Clients.Elasticsearch .NET client.
7+
The `Gridify.Elasticsearch` package includes extension methods that convert Gridify filters and sortings to Elasticsearch DSL queries using the Elastic.Clients.Elasticsearch .NET client.
88

99
## Installation
1010

docs/pages/guide/extensions/entityframework.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Gridify.EntityFramework Package
44

5-
The `Gridify.EntityFramework` package has two additional `GridifyAsync()` and `GridifyQueryableAsync()` methods.
5+
The `Gridify.EntityFramework` package includes two additional methods: `GridifyAsync()` and `GridifyQueryableAsync()`.
66

77
## Installation
88

@@ -18,19 +18,19 @@ Install-Package Gridify.EntityFramework -Version {{ $version }}
1818
dotnet add package Gridify.EntityFramework --version {{ $version }}
1919
```
2020

21-
## Compatibility layer
21+
## Compatibility Layer
2222

23-
If you want to use gridify with Entity Framework, you should enable the compatibility layer:
23+
To use Gridify with Entity Framework, enable the compatibility layer:
2424

2525
``` csharp
2626
GridifyGlobalConfiguration.EnableEntityFrameworkCompatibilityLayer();
2727
```
2828

2929
Enabling the compatibility layer provides the following features:
3030

31-
- It tweaks the internal expression builder to make it compatible with Entity Framework.
31+
- Tweaks the internal expression builder for Entity Framework compatibility
3232
- EF query optimization
33-
- EF ServiceProviderCaching support
33+
- EF ServiceProvider caching support
3434
- Creates parameterized queries
3535

3636
``` sql

docs/pages/guide/extensions/gridify-client.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Gridify Client Library
22

3-
The Gridify Client library is a lightweight JavaScript and TypeScript library designed to simplify the creation of
4-
dynamic queries on the client side. This library facilitates the construction of queries that can be seamlessly
5-
integrated with your server-side APIs, leveraging the powerful features of Gridify.
3+
The Gridify Client library is a lightweight JavaScript and TypeScript library designed to simplify creating dynamic queries on the client side. This library facilitates building queries that can be seamlessly integrated with your server-side APIs, leveraging the powerful features of Gridify.
64

75
## Installation
86

docs/pages/guide/filtering.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ this query matches with JOHN - john - John - jOHn ...
6363

6464
## Escaping
6565

66-
Gridify have five special operators `, | ( ) /i` to handle complex queries and case-insensitive searches. If you want
67-
to use these characters in your query values (after conditional operator), you should add a backslash <code>\ </code>
68-
before them. having this regex could be helpful `([(),|]|\/i)`.
66+
Gridify has five special operators: `, | ( ) /i` that are used to handle complex queries and case-insensitive searches. If you want to use these characters as literal values in your queries (after the conditional operator), you need to escape them by adding a backslash `\` before each one. This regex pattern can help identify characters that need escaping: `([(),|]|\/i)`.
6967

7068
JavaScript escape example:
7169

@@ -113,15 +111,12 @@ Check out [Defining Mappings for Indexable Properties](./gridifyMapper.md#defini
113111

114112
## Custom Operators
115113

116-
Sometimes the default Gridify operators are not enough, For example, if you need an operator for regex matching or when
117-
you are using the EntityFramework, you may want to use `EF.Functions.FreeText` rather than a LIKE with wildcards. In
118-
this case, you can define your own operators. (added in `v2.6.0`)
114+
Sometimes the default Gridify operators are not enough. For example, if you need an operator for regex matching, or when using Entity Framework and you want to use `EF.Functions.FreeText` instead of a LIKE with wildcards. In these cases, you can define your own custom operators (added in `v2.6.0`).
119115

120-
To define a custom operator, you need to create a class that implements the `IGridifyOperator` interface. then you need
121-
to register it through the global [CustomOperators](./gridifyGlobalConfiguration.md#customoperators) configuration.
116+
To define a custom operator, create a class that implements the `IGridifyOperator` interface, then register it through the global [CustomOperators](./gridifyGlobalConfiguration.md#customoperators) configuration.
122117

123118
::: tip
124-
Custom operators must be start with the `#` character.
119+
Custom operators must start with the `#` character.
125120
:::
126121

127122
- FreeTextOperator Example:

docs/pages/guide/getting-started.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11

22
# Getting Started
33

4-
There are three packages available for gridify in the nuget repository:
4+
There are three main packages available for Gridify on NuGet:
55

66
- [Gridify](https://www.nuget.org/packages/Gridify/)
77
- [Gridify.EntityFramework](https://www.nuget.org/packages/Gridify.EntityFramework/)
8+
- [Gridify.Elasticsearch](https://www.nuget.org/packages/Gridify.Elasticsearch/)
89

910
::: tip
10-
If you are using the Entity Framework in your project, you should install the `Gridify.EntityFramework` package instead of `Gridify`.
11+
If you are using Entity Framework in your project, install the `Gridify.EntityFramework` package instead of `Gridify`.
1112

12-
This package provides the same functionality as the `Gridify` package but is designed to be more compatible with [Entity Framework](./extensions/entityframework).
13+
This package provides the same functionality as the `Gridify` package but is optimized for [Entity Framework](./extensions/entityframework) compatibility.
1314
:::
1415

15-
---
16-
17-
- [Gridify.Elasticsearch](https://www.nuget.org/packages/Gridify.Elasticsearch/)
18-
1916
::: tip
20-
To use Gridify with Elasticsearch, it's necessary to install [`Gridify.Elasticsearch`](./extensions/elasticsearch).
17+
To use Gridify with Elasticsearch, install the [`Gridify.Elasticsearch`](./extensions/elasticsearch) package.
2118
:::
2219

2320
---

0 commit comments

Comments
 (0)