-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigureSitecore.cs
53 lines (48 loc) · 1.97 KB
/
ConfigureSitecore.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ConfigureSitecore.cs" company="Sitecore Corporation">
// Copyright (c) Sitecore Corporation 1999-2017
// </copyright>
// <summary>
// The SamplePlugin startup class.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Sitecore.Foundation.Commerce.Engine.Plugin.EPF
{
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Sitecore.Commerce.Core;
using Sitecore.Framework.Configuration;
using Sitecore.Framework.Pipelines.Definitions.Extensions;
using Pipelines;
using Pipelines.Blocks;
using Commands;
/// <summary>
/// The carts configure sitecore class.
/// </summary>
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
.AddPipeline<SamplePipeline, SamplePipeline>(
configure =>
{
configure.Add<SampleBlock>();
})
.AddPipeline<ICreateFilePipeline, CreateFilePipeline>(builder => builder
.Add<CreateFileBlock>())
.ConfigurePipeline<IConfigureServiceApiPipeline>(configure => configure.Add<Sitecore.Foundation.Commerce.Engine.Plugin.EPF.Pipelines.ConfigureServiceApiBlock>())
);
services
.AddScoped<SampleCommand, SampleCommand>().AddScoped<CreateFileCommand, CreateFileCommand>();
}
}
}