Last active
October 9, 2017 14:08
-
-
Save websterian/3c915368274d76c11ff20944f0d5e2da to your computer and use it in GitHub Desktop.
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
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