-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathStartup.cs
More file actions
92 lines (83 loc) · 3.55 KB
/
Startup.cs
File metadata and controls
92 lines (83 loc) · 3.55 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using OrchardCore.BackgroundTasks;
using OrchardCore.ContentManagement.Handlers;
using OrchardCore.Data;
using OrchardCore.Data.Migration;
using OrchardCore.Deployment;
using OrchardCore.DisplayManagement.Extensions;
using OrchardCore.Indexing.Core;
using OrchardCore.Indexing.Core.Deployments;
using OrchardCore.Indexing.Core.Handlers;
using OrchardCore.Indexing.Core.Recipes;
using OrchardCore.Indexing.DataMigrations;
using OrchardCore.Indexing.Deployments;
using OrchardCore.Indexing.Drivers;
using OrchardCore.Indexing.Indexing;
using OrchardCore.Indexing.Models;
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Recipes;
using OrchardCore.Search.Indexing.Core;
using OrchardCore.Security.Permissions;
namespace OrchardCore.Indexing;
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddIndexingCore();
services.AddDataMigration<RecordIndexingTaskMigrations>();
#pragma warning disable CS0618 // Type or member is obsolete
services.AddDataMigration<Migrations>();
#pragma warning restore CS0618 // Type or member is obsolete
services.AddNavigationProvider<AdminMenu>();
services.AddDisplayDriver<IndexProfile, IndexProfileDisplayDriver>();
services.AddPermissionProvider<IndexingPermissionsProvider>();
services.AddDataMigration<PreviewIndexingMigrations>();
services
.AddIndexProvider<IndexProfileIndexProvider>()
.AddDataMigration<IndexingMigrations>();
}
}
[RequireFeatures("OrchardCore.Contents")]
public sealed class ContentStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.TryAddEnumerable(ServiceDescriptor.Scoped<IContentHandler, IndexingContentHandler>());
services.AddScoped<IContentHandler, CreateIndexingTaskContentHandler>();
services.TryAddScoped<ContentIndexingService>();
services.AddIndexProfileHandler<ContentIndexProfileHandler>();
services.AddDisplayDriver<IndexProfile, ContentIndexProfileDisplayDriver>();
services.TryAddEnumerable(ServiceDescriptor.Scoped<IModularTenantEvents, ContentIndexInitializerService>());
services.AddDataMigration<WorkerFeatureMigrations>();
}
}
[RequireFeatures("OrchardCore.Recipes.Core")]
public sealed class RecipesStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddRecipeExecutionStep<CreateOrUpdateIndexProfileStep>();
services.AddRecipeExecutionStep<ResetIndexStep>();
services.AddRecipeExecutionStep<RebuildIndexStep>();
}
}
[RequireFeatures("OrchardCore.Deployment")]
public sealed class DeploymentsStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddDeployment<IndexProfileDeploymentSource, IndexProfileDeploymentStep, IndexProfileDeploymentStepDisplayDriver>();
services.AddDeployment<RebuildIndexDeploymentSource, RebuildIndexDeploymentStep, RebuildIndexDeploymentStepDriver>();
services.AddDeployment<ResetIndexDeploymentSource, ResetIndexDeploymentStep, ResetIndexDeploymentStepDriver>();
}
}
[Feature(IndexingConstants.Feature.Worker)]
public sealed class WorkerStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IBackgroundTask, ContentIndexingBackgroundTask>();
}
}