mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(directory): ✨ flesh out GetMaintainers query
This commit is contained in:
parent
b794fa559c
commit
9d8a023ba2
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
|
|
@ -33,6 +34,7 @@ public async Task<IEnumerable<MaintainerViewModel>> Handle(
|
|||
CancellationToken cancellationToken)
|
||||
{
|
||||
return await _context.Maintainers
|
||||
.OrderBy(m => m.Id)
|
||||
.ProjectTo<MaintainerViewModel>(_mapper.ConfigurationProvider)
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
||||
|
|
@ -42,7 +44,10 @@ public class MaintainerViewModelProfile : Profile
|
|||
{
|
||||
public MaintainerViewModelProfile()
|
||||
{
|
||||
CreateMap<Maintainer, MaintainerViewModel>();
|
||||
CreateMap<Maintainer, MaintainerViewModel>()
|
||||
.ForMember(m => m.FilterListIds,
|
||||
o => o.MapFrom(m =>
|
||||
m.FilterListMaintainers.Select(flm => flm.FilterListId).OrderBy(flid => flid)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue