|
|
|
@ -1,12 +1,9 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using MongoDB.Driver.Linq;
|
|
|
|
|
using Volo.Abp.Domain.Repositories.MongoDB;
|
|
|
|
|
using Volo.Abp.MongoDB;
|
|
|
|
|
using Volo.Blogging.MongoDB;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Linq.Dynamic.Core;
|
|
|
|
|
|
|
|
|
|
namespace Volo.Blogging.Blogs
|
|
|
|
|
{
|
|
|
|
@ -21,15 +18,6 @@ namespace Volo.Blogging.Blogs
|
|
|
|
|
return await GetMongoQueryable().FirstOrDefaultAsync(p => p.ShortName == shortName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<List<Blog>> GetListAsync(string sorting, int maxResultCount, int skipCount)
|
|
|
|
|
{
|
|
|
|
|
var auditLogs = GetMongoQueryable().OrderBy(sorting ?? "creationTime desc").As<IMongoQueryable<Blog>>()
|
|
|
|
|
.PageBy(skipCount, maxResultCount)
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
return auditLogs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<int> GetTotalCount()
|
|
|
|
|
{
|
|
|
|
|
return await GetMongoQueryable().CountAsync();
|
|
|
|
|