This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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