-
Notifications
You must be signed in to change notification settings - Fork 14
/
DoStuffComposer.cs
30 lines (25 loc) · 944 Bytes
/
DoStuffComposer.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
using DoStuff.Core.Configuration;
using DoStuff.Core.Events;
using DoStuff.Core.Services;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Extensions;
namespace DoStuff.Core
{
public class DoStuffComposer : IUserComposer
{
public void Compose(IUmbracoBuilder builder)
{
// Add Options
builder.Services.Configure<DoStuffOptions>(builder.Config.GetSection(DoStuffOptions.DoStuffSection));
// Add services
builder.Services.AddUnique<DoStuffService>();
// Add Event handlers
builder.AddNotificationHandler<ServerVariablesParsingNotification, DoStuffServerVariablesNotifcationHandler>();
builder.AddNotificationHandler<ContentSavedNotification, DoStuffContentNotificationHandler>();
}
}
}