Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
namespace Sitecore.Commerce.Plugin.AdventureWorks
{
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Sitecore.Commerce.Core;
using Sitecore.Framework.Configuration;
using Sitecore.Framework.Pipelines.Definitions.Extensions;
/// <summary>
/// Defines the configure sitecore class for the AdventureWorks plugin.
/// </summary>
/// <seealso cref="Sitecore.Framework.Configuration.IConfigureSitecore" />
public class ConfigureSitecore : IConfigureSitecore
{
/// <summary>
/// The configure services.
/// </summary>
/// <param name="services">
/// The services.
/// </param>
public void ConfigureServices(IServiceCollection services)
{
var assembly = Assembly.GetExecutingAssembly();
services.RegisterAllPipelineBlocks(assembly);
services.Sitecore().Pipelines(config => config
.ConfigurePipeline<IBootstrapPipeline>(d => d.Add<BootstrapAwEnvironmentBlock>())
.ConfigurePipeline<IInitializeEnvironmentPipeline>(d =>
{
d.Add<BootstrapManagedListsBlock>()
.Add<InitializeEnvironmentRegionsBlock>()
.Add<InitializeEnvironmentPolicySetsBlock>()
.Add<InitializeEnvironmentShopsBlock>()
.Add<InitializeEnvironmentSellableItemsBlock>()
.Add<InitializeEnvironmentPricingBlock>()
.Add<InitializeEnvironmentPromotionsBlock>();
})
.ConfigurePipeline<IStartEnvironmentPipeline>(d => { })
.ConfigurePipeline<IRunningPluginsPipeline>(c => { c.Add<RegisteredPluginBlock>().After<RunningPluginsBlock>(); })
// Registers the route for our custom command
.ConfigurePipeline<IConfigureServiceApiPipeline>(c => c.Add<Pipelines.Blocks.ConfigureServiceApiBlock>()));
services.ConfigureCartPipelines();
services.ConfigureOrdersPipelines();
services.RegisterAllCommands(assembly);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment