Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created July 12, 2020 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xximjasonxx/9f8c34b7d19a9329d091c2b5d3f6ede7 to your computer and use it in GitHub Desktop.
Save xximjasonxx/9f8c34b7d19a9329d091c2b5d3f6ede7 to your computer and use it in GitHub Desktop.
[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