Created
August 8, 2022 13:48
-
-
Save cch12313/d2f76137da9a6e0190be7470734cc606 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
public class HappyService | |
{ | |
public HappyService() | |
{ | |
Console.WriteLine("HappyService create"); | |
} | |
public void Do() | |
{ | |
Console.WriteLine("Ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha"); | |
} | |
} | |
[ApiController] | |
[Route("[controller]")] | |
public class WeatherForecastController : ControllerBase | |
{ | |
private readonly HappyService _happy; | |
public WeatherForecastController(HappyService happy) | |
{ | |
_happy = happy; | |
} | |
[HttpGet] | |
public ActionResult Get() | |
{ | |
_happy.Do(); | |
return Ok(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment