Fix logic for counting blog posts
This commit is contained in:
parent
93cfc85b4c
commit
0460f8c945
1 changed files with 2 additions and 1 deletions
|
@ -35,7 +35,8 @@ namespace Robware.Data {
|
|||
|
||||
public async Task<IEnumerable<BlogPost>> GetAllPostsAsync() => MapStateToPost((await _collection.FindAsync(post => !post.Deleted)).ToEnumerable());
|
||||
|
||||
private async Task<int> GetCountAsync(bool includeAll) => (int)await _collection.CountDocumentsAsync(post => includeAll || (!post.Deleted && string.IsNullOrEmpty(post.Content)));
|
||||
private async Task<int> GetCountAsync(bool includeAll) =>
|
||||
(int)await _collection.CountDocumentsAsync(post => includeAll || !(post.Deleted || string.IsNullOrEmpty(post.Content)));
|
||||
|
||||
public async Task<int> GetCountAsync() => await GetCountAsync(false);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue