コード例 #1
0
        public async Task <ActionResult <IEnumerable <ExameViewModel> > > GetAll()
        {
            var exameList = await _exameRepository.GetAllAsync();

            var result = new List <ExameViewModel>();

            foreach (var exame in exameList)
            {
                result.Add(
                    new ExameViewModel
                {
                    Id        = exame.Id,
                    Descricao = exame.Descricao,
                    Preco     = exame.Preco
                });
            }

            return(Ok(result));
        }