Created
December 17, 2018 18:12
-
-
Save websterian/a050b6bda24f55049139770581adf9cf to your computer and use it in GitHub Desktop.
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