示例#1
0
        public async Task <BirdListDto> Handle(GetBirdsQuery request, CancellationToken cancellationToken)
        {
            var allBirds = await _birdRepository.GetAll();

            return(new BirdListDto
            {
                Birds = allBirds.Select(bird => new BirdDto
                {
                    Id = bird.Id,
                    Latin = bird.LatinName,
                    Name = bird.EnglishName
                }).ToList()
                        // TODO: add Automapper!
            });
        }
示例#2
0
 public void OnGet()
 {
     Birds = _birdsRepo.GetAll();
 }