Example #1
0
        public async Task <IActionResult> Get(string lineName)
        {
            try
            {
                var line = await _service.GetByLineNameAsync(lineName);

                var response = _mapper.Map <LineDTO>(line);

                return(Ok(response));
            }
            catch (InvalidOperationException)
            {
                return(BadRequest($"Linha {lineName} não encontrada."));
            }
        }