From 9bf6c1748dae6edacca9f818d2993146e021a045 Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Fri, 21 Jun 2024 21:44:30 +0300 Subject: [PATCH] Sorting broke --- .../Repositories/CrashReportEntityRepository.cs | 3 ++- src/BUTR.Site.NexusMods.Server/Repositories/IRepository.cs | 6 ++++-- .../Repositories/NexusModsUserRepository.cs | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/BUTR.Site.NexusMods.Server/Repositories/CrashReportEntityRepository.cs b/src/BUTR.Site.NexusMods.Server/Repositories/CrashReportEntityRepository.cs index d795dcb0..7f0a6508 100644 --- a/src/BUTR.Site.NexusMods.Server/Repositories/CrashReportEntityRepository.cs +++ b/src/BUTR.Site.NexusMods.Server/Repositories/CrashReportEntityRepository.cs @@ -104,6 +104,7 @@ IQueryable DbQueryBase(Expression moduleIds.Contains(y.Module.ModuleId)) || x.ModuleInfos.Where(y => y.NexusModsMod != null).Any(y => nexusModsModIds.Contains(y.NexusModsMod!.NexusModsModId))); - return await dbQuery.PaginatedGroupedAsync(query.Page, query.PageSize, ct); + //return await dbQuery.PaginatedGroupedAsync(query.Page, query.PageSize, ct); + return await dbQuery.PaginatedAsync(query.Page, query.PageSize, ct); } } \ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.Server/Repositories/IRepository.cs b/src/BUTR.Site.NexusMods.Server/Repositories/IRepository.cs index 46c47b23..ddedce4e 100644 --- a/src/BUTR.Site.NexusMods.Server/Repositories/IRepository.cs +++ b/src/BUTR.Site.NexusMods.Server/Repositories/IRepository.cs @@ -129,12 +129,14 @@ public async Task> GetAllAsync(Expression> PaginatedAsync(PaginatedQuery query, uint maxPageSize = 20, Sorting? defaultSorting = default, CancellationToken ct = default) => InternalQuery - .PaginatedGroupedAsync(query, maxPageSize, defaultSorting, ct); + //.PaginatedGroupedAsync(query, maxPageSize, defaultSorting, ct); + .PaginatedAsync(query, maxPageSize, defaultSorting, ct); public Task> PaginatedAsync(Expression> projection, PaginatedQuery query, uint maxPageSize = 20, Sorting? defaultSorting = default, CancellationToken ct = default) where TProjection : class => InternalQuery .Select(projection) - .PaginatedGroupedAsync(query, maxPageSize, defaultSorting, ct); + //.PaginatedGroupedAsync(query, maxPageSize, defaultSorting, ct); + .PaginatedAsync(query, maxPageSize, defaultSorting, ct); public virtual void Add(TEntity entity) => _dbContext.Set() diff --git a/src/BUTR.Site.NexusMods.Server/Repositories/NexusModsUserRepository.cs b/src/BUTR.Site.NexusMods.Server/Repositories/NexusModsUserRepository.cs index 0a3e3201..1aa812e9 100644 --- a/src/BUTR.Site.NexusMods.Server/Repositories/NexusModsUserRepository.cs +++ b/src/BUTR.Site.NexusMods.Server/Repositories/NexusModsUserRepository.cs @@ -124,7 +124,8 @@ public async Task> GetNexusModsModsPaginatedAsync(Nex }); return await availableModsByNexusModsModLinkage - .PaginatedGroupedAsync(query, 20, new() { Property = nameof(UserLinkedModModel.NexusModsModId), Type = SortingType.Ascending }, ct); + //.PaginatedGroupedAsync(query, 20, new() { Property = nameof(UserLinkedModModel.NexusModsModId), Type = SortingType.Ascending }, ct); + .PaginatedAsync(query, 20, new() { Property = nameof(UserLinkedModModel.NexusModsModId), Type = SortingType.Ascending }, ct); } public async Task> GetAvailableModsPaginatedAsync(NexusModsUserId userId, PaginatedQuery query, CancellationToken ct)