Created
November 29, 2020 06:40
-
-
Save wk-j/f03769e31cc7a2a4bfb4d6fef49993ef to your computer and use it in GitHub Desktop.
499
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
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Logging; | |
namespace MyWeb.Controllers.Hello { | |
[ApiController] | |
[Route("api/[controller]/[action]")] | |
public class HelloController : ControllerBase { | |
private readonly ILogger<HelloController> _logger; | |
public HelloController(ILogger<HelloController> logger) { | |
_logger = logger; | |
} | |
[HttpGet("{delay}")] | |
public async Task<string> Hi(int delay) { | |
_logger.LogInformation("Start ..."); | |
await Task.Delay(1000 * 60 * delay); | |
_logger.LogInformation("End ..."); | |
return "Hello"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment