Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment