Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created December 22, 2016 21:14
Show Gist options
  • Save dcomartin/3f2607ad73f0cfa3fd38dd8724103278 to your computer and use it in GitHub Desktop.
Save dcomartin/3f2607ad73f0cfa3fd38dd8724103278 to your computer and use it in GitHub Desktop.
public class HomeController : Controller
{
private readonly IHomeHandler _handler;
public HomeController(IHomeHandler handler)
{
_handler = handler;
}
[HttpGet("/")]
public async Task<IActionResult> Home()
{
var viewModel = await _handler.Handle(new Home());
return View(viewModel);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment