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
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Sitecore.Commerce.Core; | |
using Sitecore.Commerce.Core.Commands; | |
using Sitecore.Services.Examples.Catalog.Pipelines; | |
using Sitecore.Services.Examples.Catalog.Pipelines.Arguments; | |
namespace Sitecore.Services.Examples.Catalog.Commands | |
{ | |
public class CreateUpdateSellableItemCommand : CommerceCommand | |
{ | |
private readonly ICreateUpdateSellableItemPipeline _pipeline; | |
public CreateUpdateSellableItemCommand(ICreateUpdateSellableItemPipeline pipeline, IServiceProvider serviceProvider) : base(serviceProvider) | |
{ | |
_pipeline = pipeline; | |
} | |
public async Task<bool> Process(CommerceContext commerceContext, List<CreateUpdateSellableItemArgument> args) | |
{ | |
using (var activity = CommandActivity.Start(commerceContext, this)) | |
{ | |
var result = await _pipeline.Run(args, new CommercePipelineExecutionContextOptions(commerceContext)); | |
return result; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment