mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(directory): ✨ flesh out GetSoftware query
This commit is contained in:
parent
0885d53a87
commit
571cc8b7fb
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<SoftwareViewModel>> Handle(
|
|||
CancellationToken cancellationToken)
|
||||
{
|
||||
return await _context.Software
|
||||
.OrderBy(s => s.Id)
|
||||
.ProjectTo<SoftwareViewModel>(_mapper.ConfigurationProvider)
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
||||
|
|
@ -42,7 +44,10 @@ public class SoftwareViewModelProfile : Profile
|
|||
{
|
||||
public SoftwareViewModelProfile()
|
||||
{
|
||||
CreateMap<Software, SoftwareViewModel>();
|
||||
CreateMap<Software, SoftwareViewModel>()
|
||||
.ForMember(s => s.SyntaxIds,
|
||||
o => o.MapFrom(s =>
|
||||
s.SoftwareSyntaxes.Select(ss => ss.SyntaxId).OrderBy(sid => sid)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue