Example #1
0
        public async Task <ActionResult> ObterRestaurantes()
        {
            var restaurantes = await _restauranteRepository.ObterTodos();

            var listagem = restaurantes.Select(_ => new RestauranteListagem
            {
                Id      = _.Id,
                Nome    = _.Nome,
                Cozinha = (int)_.Cozinha,
                Cidade  = _.Endereco.Cidade
            });

            return(Ok(
                       new
            {
                data = listagem
            }
                       ));
        }