Guest User

Untitled

a guest
Dec 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading.Tasks;
  4. using Sitecore.Commerce.Core;
  5. using Sitecore.Commerce.Core.Commands;
  6. using Sitecore.Services.Examples.Catalog.Pipelines;
  7. using Sitecore.Services.Examples.Catalog.Pipelines.Arguments;
  8.  
  9. namespace Sitecore.Services.Examples.Catalog.Commands
  10. {
  11. public class CreateUpdateSellableItemCommand : CommerceCommand
  12. {
  13. private readonly ICreateUpdateSellableItemPipeline _pipeline;
  14.  
  15. public CreateUpdateSellableItemCommand(ICreateUpdateSellableItemPipeline pipeline, IServiceProvider serviceProvider) : base(serviceProvider)
  16. {
  17. _pipeline = pipeline;
  18. }
  19.  
  20. public async Task<bool> Process(CommerceContext commerceContext, List<CreateUpdateSellableItemArgument> args)
  21. {
  22. using (var activity = CommandActivity.Start(commerceContext, this))
  23. {
  24. var result = await _pipeline.Run(args, new CommercePipelineExecutionContextOptions(commerceContext));
  25.  
  26. return result;
  27. }
  28. }
  29. }
  30. }
Add Comment
Please, Sign In to add comment