@ -68,7 +68,7 @@ namespace Volo.CmsKit.Blogs
.WhereIf(blogId.HasValue, x => x.BlogId == blogId)
.WhereIf(!string.IsNullOrWhiteSpace(filter), x => x.Title.Contains(filter) || x.Slug.Contains(filter));
queryable = queryable.OrderBy(sorting ?? $"{nameof(BlogPost.CreationTime)} desc");
queryable = queryable.OrderBy(sorting.IsNullOrEmpty() ? $"{nameof(BlogPost.CreationTime)} desc" : sorting);
var combinedResult = await queryable
.Join(
@ -38,7 +38,7 @@ namespace Volo.CmsKit.Blogs
{
var query = await GetListQueryAsync(filter);
return await query.OrderBy(sorting ?? "creationTime desc")
return await query.OrderBy(sorting.IsNullOrEmpty() ? "creationTime desc" : sorting)
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}
@ -74,7 +74,7 @@ namespace Volo.CmsKit.Comments
sorting = "comment." + sorting;
query = query.OrderBy(sorting ?? "comment.creationTime desc")
query = query.OrderBy(sorting.IsNullOrEmpty() ? "comment.creationTime desc" : sorting)
.PageBy(skipCount, maxResultCount);
return await query.ToListAsync(token);
@ -40,7 +40,7 @@ namespace Volo.CmsKit.Pages
!filter.IsNullOrWhiteSpace(),
x =>
x.Title.Contains(filter))
.OrderBy(sorting ?? nameof(Page.Title))
.OrderBy(sorting.IsNullOrEmpty() ? nameof(Page.Title) : sorting)
@ -71,7 +71,7 @@ namespace Volo.CmsKit.MongoDB.Blogs
var combinedQueryable = queryable
@ -43,7 +43,7 @@ namespace Volo.CmsKit.MongoDB.Blogs
var query = await GetListQueryAsync(filter, token);
.As<IMongoQueryable<Blog>>()
.PageBy<Blog, IMongoQueryable<Blog>>(skipCount, maxResultCount)
.ToListAsync(token);
@ -67,7 +67,7 @@ namespace Volo.CmsKit.MongoDB.Comments
creationEndDate,
token);
var comments = await query.OrderBy(sorting ?? "creationTime desc")
var comments = await query.OrderBy(sorting.IsNullOrEmpty() ? "creationTime desc" : sorting)
.As<IMongoQueryable<Comment>>()
.PageBy<Comment, IMongoQueryable<Comment>>(skipCount, maxResultCount)
@ -49,7 +49,7 @@ namespace Volo.CmsKit.MongoDB.Pages
u =>
u.Title.Contains(filter)
)
.As<IMongoQueryable<Page>>()
.PageBy<Page, IMongoQueryable<Page>>(skipCount, maxResultCount)
.ToListAsync(cancellation);