Skip to content

Instantly share code, notes, and snippets.

@websterian
Last active October 9, 2017 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save websterian/3c915368274d76c11ff20944f0d5e2da to your computer and use it in GitHub Desktop.
Save websterian/3c915368274d76c11ff20944f0d5e2da to your computer and use it in GitHub Desktop.
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