Skip to content

Commit ed3e4af

Browse files
MnatsakanMargaryanMnatsakanMargaryan
authored andcommitted
readme updated and small clean-up
1 parent 549eef5 commit ed3e4af

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ var pagedResponse = await dbContext.Books
105105

106106
Use ColumnDistinctValuesAsync to get distinct values of a specific column:
107107
```csharp
108-
public static async Task<PagedResponse<object>> ColumnDistinctValuesAsync<TEntity>(
109-
this IQueryable<TEntity> query, ColumnDistinctValueQueryModel model,
108+
public static async Task<CursoredResponse<object>> ColumnDistinctValuesAsync<TEntity>(
109+
this IQueryable<TEntity> query, ColumnDistinctValueCursoredQueryModel model,
110110
Func<byte[], string>? decryptor = default, CancellationToken cancellationToken = default)
111111

112112
```
113113
Example Usage:
114114
```csharp
115115
var distinctValues = await dbContext.Books
116-
.ColumnDistinctValuesAsync(new ColumnDistinctValueQueryModel { PropertyName = "Title" }, cancellationToken);
116+
.ColumnDistinctValuesAsync(new ColumnDistinctValueCursoredQueryModel { PropertyName = "Title", PageSize=50, Filter="Title>abc" }, cancellationToken);
117117
```
118118

119119
Use AggregateAsync to perform aggregation operations on your data:

src/GridifyExtensions/Extensions/QueryableExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public static async Task<CursoredResponse<object>> ColumnDistinctValuesAsync<TEn
115115
{
116116
var mapper = EntityGridifyMapperByType[typeof(TEntity)] as FilterMapper<TEntity>;
117117

118-
var gridifyModel = ColumnDistinctValueCursoredQueryModel.ToGridifyQueryModel(model);
118+
var gridifyModel = model.ToGridifyQueryModel();
119119

120120
if (!mapper!.IsEncrypted(model.PropertyName))
121121
{

src/GridifyExtensions/GridifyExtensions.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
<PackageReadmeFile>Readme.md</PackageReadmeFile>
99
<Authors>Pandatech</Authors>
1010
<Copyright>MIT</Copyright>
11-
<Version>1.3.6</Version>
11+
<Version>1.3.7</Version>
1212
<PackageId>Pandatech.GridifyExtensions</PackageId>
1313
<Title>Pandatech.Gridify.Extensions</Title>
1414
<PackageTags>Pandatech, library, Gridify, Pagination, Filters</PackageTags>
1515
<Description>Pandatech.Gridify.Extensions simplifies and extends the functionality of the Gridify NuGet package. It provides additional extension methods and functionality to streamline data filtering and pagination, making it more intuitive and powerful to use in .NET applications. Our enhancements ensure more flexibility, reduce boilerplate code, and improve overall developer productivity when working with Gridify.</Description>
1616
<RepositoryUrl>https://github.com/PandaTechAM/be-lib-gridify-extensions</RepositoryUrl>
17-
<PackageReleaseNotes>Bug fix related to column distict values ordering</PackageReleaseNotes>
17+
<PackageReleaseNotes>Readme updated</PackageReleaseNotes>
1818
</PropertyGroup>
1919

2020
<ItemGroup>

src/GridifyExtensions/Models/ColumnDistinctValueCursoredQueryModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public required int PageSize
2525
public required string PropertyName { get; set; }
2626
public string? Filter { get; set; }
2727

28-
public static GridifyQueryModel ToGridifyQueryModel(ColumnDistinctValueCursoredQueryModel model)
28+
public GridifyQueryModel ToGridifyQueryModel()
2929
{
3030
return new GridifyQueryModel
3131
{
3232
Page = 1,
33-
PageSize = model.PageSize,
34-
Filter = model.Filter
33+
PageSize = PageSize,
34+
Filter = Filter
3535
};
3636
}
3737
}

0 commit comments

Comments
 (0)