From da6f72333ee12eddc6ab55b6b9080d27b7a4bfa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ak=C4=B1n=20Sabri=20=C3=87am?= Date: Mon, 2 Mar 2020 17:19:14 +0300 Subject: [PATCH] code fixed --- .../Volo/Blogging/Posts/PostWithDetailsDto.cs | 1 - .../Volo/Blogging/Blogs/BlogConsts.cs | 2 -- .../Volo/Blogging/Posts/MongoPostRepository.cs | 9 +++++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/PostWithDetailsDto.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/PostWithDetailsDto.cs index ff831031aa..08dde7e019 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/PostWithDetailsDto.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/PostWithDetailsDto.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Reflection; using JetBrains.Annotations; using Volo.Abp.Application.Dtos; using Volo.Blogging.Tagging.Dtos; diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs index bb107e7971..502a4364e7 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs @@ -7,7 +7,5 @@ public const int MaxShortNameLength = 32; public const int MaxDescriptionLength = 1024; - - public const string BlogName = "blog"; } } diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs index 223aa8968e..16dfdd1d74 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs @@ -33,9 +33,14 @@ namespace Volo.Blogging.Posts return post; } - public Task> GetOrderedList(Guid blogId, bool @descending = false) + public async Task> GetOrderedList(Guid blogId, bool @descending = false) { - throw new NotImplementedException(); + if (!descending) + { + return await GetMongoQueryable().Where(x => x.BlogId == blogId).OrderByDescending(x => x.CreationTime).ToListAsync(); + } + return await GetMongoQueryable().Where(x => x.BlogId == blogId).OrderByDescending(x => x.CreationTime).ToListAsync(); + } } }