Browse Source

Merge branch 'master' of https://github.com/volosoft/abp

pull/848/head
Halil ibrahim Kalkan 7 years ago
parent
commit
5a2faa1e73
  1. 36
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs

36
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs

@ -79,24 +79,6 @@ namespace Volo.Blogging.Posts
return new ListResultDto<PostWithDetailsDto>(postDtos); return new ListResultDto<PostWithDetailsDto>(postDtos);
} }
private async Task<List<PostWithDetailsDto>> FilterPostsByTag(List<PostWithDetailsDto> allPostDtos, Tag tag)
{
var filteredPostDtos = new List<PostWithDetailsDto>();
var posts = await _postRepository.GetListAsync();
foreach (var postDto in allPostDtos)
{
if (!postDto.Tags.Any(p=> p.Id == tag.Id))
{
continue;
}
filteredPostDtos.Add(postDto);
}
return filteredPostDtos;
}
public async Task<PostWithDetailsDto> GetForReadingAsync(GetPostInput input) public async Task<PostWithDetailsDto> GetForReadingAsync(GetPostInput input)
{ {
var post = await _postRepository.GetPostByUrl(input.BlogId, input.Url); var post = await _postRepository.GetPostByUrl(input.BlogId, input.Url);
@ -273,5 +255,23 @@ namespace Volo.Blogging.Posts
} }
return new List<string>(tags.Split(",").Select(t => t.Trim())); return new List<string>(tags.Split(",").Select(t => t.Trim()));
} }
private async Task<List<PostWithDetailsDto>> FilterPostsByTag(List<PostWithDetailsDto> allPostDtos, Tag tag)
{
var filteredPostDtos = new List<PostWithDetailsDto>();
var posts = await _postRepository.GetListAsync();
foreach (var postDto in allPostDtos)
{
if (!postDto.Tags.Any(p => p.Id == tag.Id))
{
continue;
}
filteredPostDtos.Add(postDto);
}
return filteredPostDtos;
}
} }
} }

Loading…
Cancel
Save