Last active
January 28, 2020 22:21
-
-
Save gavilanch/09fc2b58f379461bfa32b86f6bcedd77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [HttpGet] | |
| public IEnumerable<WeatherForecast> Get() | |
| { | |
| var iteracion = 1; | |
| _logger.LogDebug($"Debug {iteracion}"); | |
| _logger.LogInformation($"Information {iteracion}"); | |
| _logger.LogWarning($"Warning {iteracion}"); | |
| _logger.LogError($"Error {iteracion}"); | |
| _logger.LogCritical($"Critical {iteracion}"); | |
| try | |
| { | |
| throw new NotImplementedException(); | |
| } | |
| catch(Exception ex) | |
| { | |
| _logger.LogError(ex, ex.Message); | |
| } | |
| var rng = new Random(); | |
| return Enumerable.Range(1, 5).Select(index => new WeatherForecast | |
| { | |
| Date = DateTime.Now.AddDays(index), | |
| TemperatureC = rng.Next(-20, 55), | |
| Summary = Summaries[rng.Next(Summaries.Length)] | |
| }) | |
| .ToArray(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment