-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathStartup.cs
More file actions
52 lines (47 loc) · 1.86 KB
/
Startup.cs
File metadata and controls
52 lines (47 loc) · 1.86 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
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Metadata.Models;
using OrchardCore.CustomSettings.Deployment;
using OrchardCore.CustomSettings.Drivers;
using OrchardCore.CustomSettings.Recipes;
using OrchardCore.CustomSettings.Services;
using OrchardCore.Deployment;
using OrchardCore.DisplayManagement.Extensions;
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Recipes;
using OrchardCore.Security.Permissions;
namespace OrchardCore.CustomSettings;
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddSiteDisplayDriver<CustomSettingsDisplayDriver>();
services.AddNavigationProvider<AdminMenu>();
services.AddScoped<CustomSettingsService>();
services.AddScoped<IStereotypesProvider, CustomSettingsStereotypesProvider>();
// Permissions
services.AddPermissionProvider<Permissions>();
services.AddScoped<IAuthorizationHandler, CustomSettingsAuthorizationHandler>();
services.AddRecipeExecutionStep<CustomSettingsStep>();
services.Configure<ContentTypeDefinitionOptions>(options =>
{
options.Stereotypes.TryAdd("CustomSettings", new ContentTypeDefinitionDriverOptions
{
ShowCreatable = false,
ShowListable = false,
ShowDraftable = false,
ShowVersionable = false,
});
});
}
}
[RequireFeatures("OrchardCore.Deployment")]
public sealed class DeploymentStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddDeployment<CustomSettingsDeploymentSource, CustomSettingsDeploymentStep, CustomSettingsDeploymentStepDriver>();
}
}