-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathStartup.cs
38 lines (33 loc) · 1.37 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
using Etch.OrchardCore.Gallery.Drivers;
using Etch.OrchardCore.Gallery.Models;
using Etch.OrchardCore.Gallery.Settings;
using Etch.OrchardCore.Gallery.ViewModels;
using Fluid;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display.ContentDisplay;
using OrchardCore.ContentTypes.Editors;
using OrchardCore.Data.Migration;
using OrchardCore.Modules;
using OrchardCore.ResourceManagement;
namespace Etch.OrchardCore.Gallery
{
public class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IConfigureOptions<ResourceManagementOptions>, ResourceManagementOptionsConfiguration>();
services.AddContentPart<GalleryPart>()
.UseDisplayDriver<GalleryPartDisplay>();
services.AddScoped<IContentTypePartDefinitionDisplayDriver, GalleryPartSettingsDriver>();
services.AddScoped<IDataMigration, Migrations>();
services.Configure<TemplateOptions>(o =>
{
o.MemberAccessStrategy.Register<GalleryPartDisplayViewModel>();
o.MemberAccessStrategy.Register<GalleryPartItemViewModel>();
o.MemberAccessStrategy.Register<GalleryPartItem>();
});
}
}
}