|
|
|
|
@ -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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|