public async void BreedsGetAllTest() { await AddBreeds(); var result = await breedsRepository.GetAllBreeds(true); Assert.NotNull(result); }
//public async Task<IEnumerable<Breeds>> GetAllBreeds() public async Task <IActionResult> GetAllBreeds() { try { stopWatch.Restart(); stopWatch.Start(); var result = await breedsRepository.GetAllBreeds(true); stopWatch.Stop(); logger.LogInformation((int)LogLevel.Information, $"Encontrados {result.Count} raças;{stopWatch.ElapsedMilliseconds}"); if (env.IsDevelopment()) { logger.LogDebug((int)LogLevel.Debug, $"Encontrados {result.Count} raças;{stopWatch.ElapsedMilliseconds}"); } return(Ok(result)); } catch (Exception ex) { logger.LogError((int)LogLevel.Error, $"Erro ao buscar raças: {ex.Message}"); return(BadRequest()); } }