Created
July 12, 2020 01:48
-
-
Save xximjasonxx/9f8c34b7d19a9329d091c2b5d3f6ede7 to your computer and use it in GitHub Desktop.
This file contains 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 async Task<IActionResult> Get() | |
{ | |
var rng = new Random(); | |
var data = 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(); | |
return Ok(new { | |
WeatherMan = (await _userService.GetUserAsync(this.User.Identity.Name)).FullName, | |
Data = data | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment