|
|
|
|
@ -36,19 +36,19 @@ namespace Volo.Blogging.Posts
|
|
|
|
|
var userDictionary = new Dictionary<Guid, BlogUserDto>();
|
|
|
|
|
var postDtos = new List<PostWithDetailsDto>(ObjectMapper.Map<List<Post>, List<PostWithDetailsDto>>(posts));
|
|
|
|
|
|
|
|
|
|
if (tag != null)
|
|
|
|
|
foreach (var postDto in postDtos)
|
|
|
|
|
{
|
|
|
|
|
postDtos = await FilterPostsByTag(postDtos, tag);
|
|
|
|
|
postDto.Tags = await GetTagsOfPost(postDto.Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var postDto in postDtos)
|
|
|
|
|
if (tag != null)
|
|
|
|
|
{
|
|
|
|
|
postDto.CommentCount = await _commentRepository.GetCommentCountOfPostAsync(postDto.Id);
|
|
|
|
|
postDtos = await FilterPostsByTag(postDtos, tag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var postDto in postDtos)
|
|
|
|
|
{
|
|
|
|
|
postDto.Tags = await GetTagsOfPost(postDto.Id);
|
|
|
|
|
postDto.CommentCount = await _commentRepository.GetCommentCountOfPostAsync(postDto.Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var postDto in postDtos)
|
|
|
|
|
|