From a6cecec7b13f750af8508050310b6fa5cea61ab3 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 30 Mar 2022 11:11:05 +0300 Subject: [PATCH] Fix wrong conflict merging from dev --- .../Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs index fc89b19cb5..129c5e10b7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs @@ -111,7 +111,7 @@ public class MongoBlogPostRepository : MongoDbRepository> GetAuthorsHasBlogPostsAsync(int skipCount, int maxResultCount, string sorting, string filter, CancellationToken cancellationToken = default) { - var queryable = (await CreateAuthorsQueryableAsync()) + var queryable = (await CreateAuthorsQueryableAsync(cancellationToken)) .Skip(skipCount) .Take(maxResultCount) .OrderBy(sorting.IsNullOrEmpty() ? nameof(CmsUser.UserName) : sorting) @@ -123,17 +123,17 @@ public class MongoBlogPostRepository : MongoDbRepository GetAuthorsHasBlogPostsCountAsync(string filter, CancellationToken cancellationToken = default) { return await AsyncExecuter.CountAsync( - (await CreateAuthorsQueryableAsync()) + (await CreateAuthorsQueryableAsync(cancellationToken)) .WhereIf(!filter.IsNullOrEmpty(), x => x.UserName.Contains(filter.ToLower()))); } public async Task GetAuthorHasBlogPostAsync(Guid id, CancellationToken cancellationToken = default) { - return await AsyncExecuter.FirstOrDefaultAsync(await CreateAuthorsQueryableAsync(), x => x.Id == id) + return await AsyncExecuter.FirstOrDefaultAsync(await CreateAuthorsQueryableAsync(cancellationToken), x => x.Id == id) ?? throw new EntityNotFoundException(typeof(CmsUser), id); } - private async Task> CreateAuthorsQueryableAsync() + private async Task> CreateAuthorsQueryableAsync(CancellationToken cancellationToken = default) { cancellationToken = GetCancellationToken(cancellationToken);