Created
November 17, 2019 13:56
-
-
Save brijbaroda/2967617aa9601a7dc06e11129d5d2c07 to your computer and use it in GitHub Desktop.
Sitecore Commerce - Localizing Category - Command
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 POC.Localization.Pipelines; | |
using POC.Localization.Pipelines.Arguments; | |
using Sitecore.Commerce.Core; | |
using Sitecore.Commerce.Core.Commands; | |
using Sitecore.Commerce.Plugin.Catalog; | |
using System; | |
using System.Threading.Tasks; | |
namespace POC.Localization.Commands | |
{ | |
class LocalizeCatalogItemsCommand : CommerceCommand | |
{ | |
private readonly ILocalizeCatalogItemsPipeline _pipeline; | |
public LocalizeCatalogItemsCommand(ILocalizeCatalogItemsPipeline pipeline,IServiceProvider serviceProvider) : base(serviceProvider) | |
{ | |
this._pipeline = pipeline; | |
} | |
/// <summary> | |
/// The process of the command | |
/// </summary> | |
/// <param name="commerceContext"> | |
/// The commerce context | |
/// </param> | |
/// <param name="parameter"> | |
/// The parameter for the command | |
/// </param> | |
/// <returns> | |
/// The <see cref="Task"/>. | |
/// </returns> | |
public async Task<string> Process(CommerceContext commerceContext) | |
{ | |
using (var activity = CommandActivity.Start(commerceContext, this)) | |
{ | |
string retVal = string.Empty; | |
var context = commerceContext.PipelineContextOptions; | |
LocalizationPipelineArgument pArg = new LocalizationPipelineArgument(); | |
retVal = await this._pipeline.Run(pArg, context); | |
return retVal; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment