Skip to content

Instantly share code, notes, and snippets.

@websterian
Created August 31, 2018 20:53
Embed
What would you like to do?
namespace Sitecore.Services.Examples.Indexing
{
using System;
using System.Threading.Tasks;
using System.Web.Http.OData;
using Microsoft.AspNetCore.Mvc;
using Sitecore.Commerce.Core;
public class CommandsController : CommerceController
{
public CommandsController(IServiceProvider serviceProvider, CommerceEnvironment globalEnvironment)
: base(serviceProvider, globalEnvironment)
{
}
[HttpPut]
[Route("GenerateFacetsCommand()")]
public async Task<IActionResult> GenerateFacetsCommand([FromBody] ODataActionParameters value)
{
string catalogId = value["catalogid"].ToString();
var command = this.Command<GenerateFacetsCommand>();
var result = await command.Process(this.CurrentContext, catalogId);
return new ObjectResult(command);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment