|
|
@ -17,13 +17,14 @@ namespace Volo.CmsKit.Pages |
|
|
{ |
|
|
{ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual async Task<int> GetCountAsync(string filter = null, CancellationToken cancellationToken = default) |
|
|
public virtual async Task<int> GetCountAsync(string filter = null, |
|
|
|
|
|
CancellationToken cancellationToken = default) |
|
|
{ |
|
|
{ |
|
|
return await (await GetDbSetAsync()).WhereIf( |
|
|
return await (await GetDbSetAsync()).WhereIf( |
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
x => |
|
|
x => |
|
|
x.Title.Contains(filter) |
|
|
x.Title.Contains(filter) |
|
|
).CountAsync(GetCancellationToken(cancellationToken)); |
|
|
).CountAsync(GetCancellationToken(cancellationToken)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual async Task<List<Page>> GetListAsync( |
|
|
public virtual async Task<List<Page>> GetListAsync( |
|
|
@ -34,12 +35,12 @@ namespace Volo.CmsKit.Pages |
|
|
CancellationToken cancellationToken = default) |
|
|
CancellationToken cancellationToken = default) |
|
|
{ |
|
|
{ |
|
|
return await (await GetDbSetAsync()).WhereIf( |
|
|
return await (await GetDbSetAsync()).WhereIf( |
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
x => |
|
|
x => |
|
|
x.Title.Contains(filter)) |
|
|
x.Title.Contains(filter)) |
|
|
.OrderBy(sorting ?? nameof(Page.Title)) |
|
|
.OrderBy(sorting ?? nameof(Page.Title)) |
|
|
.PageBy(skipCount, maxResultCount) |
|
|
.PageBy(skipCount, maxResultCount) |
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual Task<Page> GetByUrlAsync(string url, CancellationToken cancellationToken = default) |
|
|
public virtual Task<Page> GetByUrlAsync(string url, CancellationToken cancellationToken = default) |
|
|
@ -57,4 +58,4 @@ namespace Volo.CmsKit.Pages |
|
|
return await (await GetDbSetAsync()).AnyAsync(x => x.Url == url, GetCancellationToken(cancellationToken)); |
|
|
return await (await GetDbSetAsync()).AnyAsync(x => x.Url == url, GetCancellationToken(cancellationToken)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |