Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created November 7, 2019 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/c1a73981f08879f674292bd0ca1b932a to your computer and use it in GitHub Desktop.
Save dcomartin/c1a73981f08879f674292bd0ca1b932a to your computer and use it in GitHub Desktop.
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