Created
June 4, 2020 13:45
-
-
Save KeesCBakker/f9b645e9b43a5deddb2457629d9cec6f 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 interface IMessageService | |
{ | |
string GetMessage(); | |
} | |
[ApiController] | |
[Route("")] | |
public class MyController : ControllerBase | |
{ | |
private readonly IMessageService _messageService; | |
public MyController(IMessageService messageService) | |
{ | |
_messageService = messageService; | |
} | |
[HttpGet] | |
public string Get() | |
{ | |
return _messageService.GetMessage(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment