public async Task <IActionResult> Get(int eventId) { try { BatchDto[] batches = await _batchService.GetAllBatchesByEventIdAsync(eventId); //IActionResult allows to return the status code, such as Not Found (404) if (batches == null) { return(NoContent()); } //IActionResult allows to return the status code, such as Ok (200) return(Ok(batches)); } catch (Exception ex) { return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Erro ao tentar recuperar lotes. Erro: {ex.Message}")); } }