Created
November 7, 2019 01:59
-
-
Save dcomartin/c1a73981f08879f674292bd0ca1b932a 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
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
using Orleans.AspNetCore.Demo.Grains; | |
namespace Orleans.AspNetCore.Demo.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
private readonly IClusterClient _clusterClient; | |
public HomeController(IClusterClient clusterClient) | |
{ | |
_clusterClient = clusterClient; | |
} | |
public async Task<IActionResult> Index() | |
{ | |
var orderNumberGenerator = _clusterClient.GetGrain<IOrderNumberGenerator>("Demo"); | |
var orderNumber = await orderNumberGenerator.GenerateOrderNumber(); | |
return View(orderNumber); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment