Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created April 8, 2020 22:53
Show Gist options
  • Save dcomartin/63992d47e50a379b03267306189194db to your computer and use it in GitHub Desktop.
Save dcomartin/63992d47e50a379b03267306189194db to your computer and use it in GitHub Desktop.
using Coravel.Queuing.Interfaces;
using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopWeb.Web.Features;
using Microsoft.eShopWeb.Web.ViewModels.Manage;
namespace Microsoft.eShopWeb.Web.Controllers
{
[Route("[controller]/[action]")]
public class DemoController : Controller
{
private readonly IQueue _queue;
public DemoController(IQueue queue)
{
_queue = queue;
}
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult SendVerificationEmail(IndexViewModel model)
{
_queue.QueueInvocableWithPayload<DemoInvocable, string>("This is my data/parameter for my Invocable that will be put into the Payload property.");
return RedirectToAction("Index", "Manage");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment