Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
namespace Sitecore.Services.Examples.Composer
{
using System;
using System.Threading.Tasks;
using Sitecore.Commerce.Core;
using Sitecore.Commerce.Core.Commands;
using Sitecore.Commerce.Plugin.Sample;
public class CreateComposerTemplatesCommand : CommerceCommand
{
private readonly ICreateComposerTemplatesPipeline _pipeline;
public CreateComposerTemplatesCommand(ICreateComposerTemplatesPipeline pipeline, IServiceProvider serviceProvider) : base(serviceProvider)
{
this._pipeline = pipeline;
}
public async Task<bool> Process(CommerceContext commerceContext, object parameter)
{
using (var activity = CommandActivity.Start(commerceContext, this))
{
var arg = new CreateComposerTemplatesArgument(parameter);
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
You can’t perform that action at this time.