diff --git a/src/Infrastructure.Dapper/NotificationCenter/Repositories/NotificationRepository.cs b/src/Infrastructure.Dapper/NotificationCenter/Repositories/NotificationRepository.cs index 463fa22142..b6843d9801 100644 --- a/src/Infrastructure.Dapper/NotificationCenter/Repositories/NotificationRepository.cs +++ b/src/Infrastructure.Dapper/NotificationCenter/Repositories/NotificationRepository.cs @@ -48,10 +48,12 @@ public class NotificationRepository : Repository, INotificat }, commandType: CommandType.StoredProcedure); + var data = results.ToList(); + return new PagedResult { - Data = results.ToList(), - ContinuationToken = (pageNumber + 1).ToString() + Data = data, + ContinuationToken = data.Count < pageOptions.PageSize ? null : (pageNumber + 1).ToString() }; } } diff --git a/src/Infrastructure.EntityFramework/NotificationCenter/Repositories/NotificationRepository.cs b/src/Infrastructure.EntityFramework/NotificationCenter/Repositories/NotificationRepository.cs index 95096e6af3..5d1071f26c 100644 --- a/src/Infrastructure.EntityFramework/NotificationCenter/Repositories/NotificationRepository.cs +++ b/src/Infrastructure.EntityFramework/NotificationCenter/Repositories/NotificationRepository.cs @@ -71,7 +71,7 @@ public class NotificationRepository : Repository { Data = results, - ContinuationToken = (pageNumber + 1).ToString() + ContinuationToken = results.Count < pageOptions.PageSize ? null : (pageNumber + 1).ToString() }; } }