mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(directory): ✨ flesh out GetTags query
This commit is contained in:
parent
c2b348dfb9
commit
f57d435b7a
1 changed files with 6 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
|
|
@ -32,6 +33,7 @@ public async Task<IEnumerable<TagViewModel>> Handle(
|
|||
CancellationToken cancellationToken)
|
||||
{
|
||||
return await _context.Tags
|
||||
.OrderBy(t => t.Id)
|
||||
.ProjectTo<TagViewModel>(_mapper.ConfigurationProvider)
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
||||
|
|
@ -41,7 +43,10 @@ public class TagViewModelProfile : Profile
|
|||
{
|
||||
public TagViewModelProfile()
|
||||
{
|
||||
CreateMap<Tag, TagViewModel>();
|
||||
CreateMap<Tag, TagViewModel>()
|
||||
.ForMember(t => t.FilterListIds,
|
||||
o => o.MapFrom(t =>
|
||||
t.FilterListTags.Select(flt => flt.FilterListId).OrderBy(flid => flid)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue