|
|
@ -18,9 +18,9 @@ namespace Volo.CmsKit.MongoDB.Pages |
|
|
{ |
|
|
{ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual Task<int> GetCountAsync(string filter = null, CancellationToken cancellationToken = default) |
|
|
public virtual async Task<int> GetCountAsync(string filter = null, CancellationToken cancellationToken = default) |
|
|
{ |
|
|
{ |
|
|
return (await GetMongoQueryableAsync()) |
|
|
return await (await GetMongoQueryableAsync(GetCancellationToken(cancellationToken))) |
|
|
.WhereIf<Page, IMongoQueryable<Page>>( |
|
|
.WhereIf<Page, IMongoQueryable<Page>>( |
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
u => |
|
|
u => |
|
|
@ -28,14 +28,14 @@ namespace Volo.CmsKit.MongoDB.Pages |
|
|
).CountAsync(GetCancellationToken(cancellationToken)); |
|
|
).CountAsync(GetCancellationToken(cancellationToken)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual Task<List<Page>> GetListAsync( |
|
|
public virtual async Task<List<Page>> GetListAsync( |
|
|
string filter = null, |
|
|
string filter = null, |
|
|
int maxResultCount = int.MaxValue, |
|
|
int maxResultCount = int.MaxValue, |
|
|
int skipCount = 0, |
|
|
int skipCount = 0, |
|
|
string sorting = null, |
|
|
string sorting = null, |
|
|
CancellationToken cancellationToken = default) |
|
|
CancellationToken cancellationToken = default) |
|
|
{ |
|
|
{ |
|
|
return (await GetMongoQueryableAsync()) |
|
|
return await (await GetMongoQueryableAsync(GetCancellationToken(cancellationToken))) |
|
|
.WhereIf<Page, IMongoQueryable<Page>>( |
|
|
.WhereIf<Page, IMongoQueryable<Page>>( |
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
u => |
|
|
u => |
|
|
@ -57,9 +57,9 @@ namespace Volo.CmsKit.MongoDB.Pages |
|
|
return FindAsync(x => x.Url == url, cancellationToken: GetCancellationToken(cancellationToken)); |
|
|
return FindAsync(x => x.Url == url, cancellationToken: GetCancellationToken(cancellationToken)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual Task<bool> ExistsAsync(string url, CancellationToken cancellationToken = default) |
|
|
public virtual async Task<bool> ExistsAsync(string url, CancellationToken cancellationToken = default) |
|
|
{ |
|
|
{ |
|
|
return (await GetMongoQueryableAsync()).AnyAsync(x => x.Url == url, GetCancellationToken(cancellationToken)); |
|
|
return await (await GetMongoQueryableAsync(GetCancellationToken(cancellationToken))).AnyAsync(x => x.Url == url, GetCancellationToken(cancellationToken)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|