Skip to content

Instantly share code, notes, and snippets.

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
You can’t perform that action at this time.