Skip to content

Instantly share code, notes, and snippets.

@websterian
Created August 31, 2018 20:51
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 websterian/2d54ac4c5ab7648edad317ef44ab7d4a to your computer and use it in GitHub Desktop.
Save websterian/2d54ac4c5ab7648edad317ef44ab7d4a to your computer and use it in GitHub Desktop.
namespace Sitecore.Services.Examples.Indexing
{
using System;
using System.Threading.Tasks;
using Sitecore.Commerce.Core;
using Sitecore.Commerce.Core.Commands;
using Sitecore.Commerce.Plugin.Sample;
public class GenerateFacetsCommand : CommerceCommand
{
private readonly IGenerateFacetsPipeline _pipeline;
public GenerateFacetsCommand(IGenerateFacetsPipeline pipeline, IServiceProvider serviceProvider) : base(serviceProvider)
{
this._pipeline = pipeline;
}
public async Task<bool> Process(CommerceContext commerceContext, string catalogId)
{
using (var activity = CommandActivity.Start(commerceContext, this))
{
var arg = new GenerateFacetsArgument(catalogId);
var result = await this._pipeline.Run(arg, new CommercePipelineExecutionContextOptions(commerceContext));
return result;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment