-
Notifications
You must be signed in to change notification settings - Fork 3
/
Startup.cs
67 lines (60 loc) · 2.63 KB
/
Startup.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using OrchardCore.Admin;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display.ContentDisplay;
using OrchardCore.ContentManagement.Handlers;
using OrchardCore.Data.Migration;
using OrchardCore.DisplayManagement.Descriptors;
using OrchardCore.UserGroup.Controllers;
using OrchardCore.UserGroup.Drivers;
using OrchardCore.UserGroup.Models;
using OrchardCore.Modules;
using OrchardCore.Mvc.Core.Utilities;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
namespace OrchardCore.UserGroup
{
public class Startup : StartupBase
{
private readonly AdminOptions _adminOptions;
public Startup(IOptions<AdminOptions> adminOptions)
{
_adminOptions = adminOptions.Value;
}
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IDataMigration, Migrations>();
services.AddScoped<IPermissionProvider, Permissions>();
services.AddScoped<INavigationProvider, AdminUserGroup>();
// UserGroupPart;
services.AddContentPart<UserGroupListPart>()
.UseDisplayDriver<UserGroupListPartDisplayDriver>();
}
public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
{
var adminControllerName = typeof(AdminController).ControllerName();
// routes.MapAreaControllerRoute(
// name: "UserGroupCreate",
// areaName: "OrchardCore.UserGroup",
// pattern: _adminOptions.AdminUrlPrefix + "/UserGroup/Create/{id}",
// defaults: new { controller = adminControllerName, action = nameof(AdminController.Create) }
// );
// routes.MapAreaControllerRoute(
// name: "UserGroupDelete",
// areaName: "OrchardCore.UserGroup",
// pattern: _adminOptions.AdminUrlPrefix + "/UserGroup/Delete",
// defaults: new { controller = adminControllerName, action = nameof(AdminController.Delete) }
// );
// routes.MapAreaControllerRoute(
// name: "UserGroupEdit",
// areaName: "OrchardCore.UserGroup",
// pattern: _adminOptions.AdminUrlPrefix + "/UserGroup/Edit",
// defaults: new { controller = adminControllerName, action = nameof(AdminController.Edit) }
// );
}
}
}