Created
June 24, 2020 17:40
-
-
Save msciborski/44b1f22dcb8058789658b7418cce41ac 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
[Route("api/[controller]")] | |
[ApiController] | |
public class TestController : ControllerBase | |
{ | |
private readonly SenderFactory _senderFactory; | |
public TestController(SenderFactory senderFactory) | |
{ | |
_senderFactory = senderFactory; | |
} | |
[HttpGet()] | |
public async Task<IActionResult> SendMessage(string senderType) | |
{ | |
var sender = _senderFactory(senderType); | |
await sender.Send("Hi! Autofac is nice!"); | |
return Ok(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment