Yunus Emre Kalkan
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
3 deletions
-
modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs
|
|
|
@ -35,12 +35,14 @@ namespace Volo.Blogging.Posts |
|
|
|
|
|
|
|
public async Task<List<Post>> GetOrderedList(Guid blogId, bool @descending = false) |
|
|
|
{ |
|
|
|
var query = GetMongoQueryable().Where(x => x.BlogId == blogId); |
|
|
|
|
|
|
|
if (!descending) |
|
|
|
{ |
|
|
|
return await GetMongoQueryable().Where(x => x.BlogId == blogId).OrderByDescending(x => x.CreationTime).ToListAsync(); |
|
|
|
return await query.OrderBy(x => x.CreationTime).ToListAsync(); |
|
|
|
} |
|
|
|
return await GetMongoQueryable().Where(x => x.BlogId == blogId).OrderBy(x => x.CreationTime).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
return await query.OrderByDescending(x => x.CreationTime).ToListAsync(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|