This repository was archived by the owner on Dec 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathStartup.cs
More file actions
43 lines (37 loc) · 1.56 KB
/
Copy pathStartup.cs
File metadata and controls
43 lines (37 loc) · 1.56 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
using Etch.OrchardCore.Search.Drivers;
using Etch.OrchardCore.Search.Indexing;
using Etch.OrchardCore.Search.Models;
using Etch.OrchardCore.Search.Shapes;
using Etch.OrchardCore.Search.ViewModels;
using Fluid;
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display.ContentDisplay;
using OrchardCore.Data.Migration;
using OrchardCore.DisplayManagement.Descriptors;
using OrchardCore.Indexing;
using OrchardCore.Modules;
namespace Etch.OrchardCore.Search
{
public class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddContentPart<SiteSearch>()
.UseDisplayDriver<SiteSearchPartDisplay>();
services.AddContentPart<SearchablePart>()
.UseDisplayDriver<SearchablePartDisplay>();
services.AddScoped<IContentPartIndexHandler, SearchablePartIndexHandler>();
services.AddScoped<IShapeTableProvider, PagerShapesTableProvider>();
services.AddShapeAttributes<PagerShapes>();
services.AddScoped<IDataMigration, Migrations>();
services.Configure<TemplateOptions>(o =>
{
o.MemberAccessStrategy.Register<SiteSearchGroupedViewModel>();
o.MemberAccessStrategy.Register<SiteSearchListViewModel>();
o.MemberAccessStrategy.Register<SiteSearchGroupedResultsGroup>();
o.MemberAccessStrategy.Register<SiteSearchContentTypeSettings>();
});
}
}
}