-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathWebModule.cs
30 lines (26 loc) · 924 Bytes
/
WebModule.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 Autofac;
using Rabbit.Web.Impl;
using Rabbit.Web.Routes;
using Rabbit.Web.Works;
namespace Rabbit.Web
{
internal sealed class WebModule : Module
{
#region Overrides of Module
/// <summary>
/// Override to add registrations to the container.
/// </summary>
/// <remarks>
/// Note that the ContainerBuilder parameter is unique to this module.
/// </remarks>
/// <param name="builder">The builder through which components can be
/// registered.</param>
protected override void Load(ContainerBuilder builder)
{
builder.RegisterModule<WebWorkContextModule>();
builder.RegisterType<DefaultHttpContextAccessor>().As<IHttpContextAccessor>().SingleInstance();
builder.RegisterType<ShellRoute>().InstancePerDependency();
}
#endregion Overrides of Module
}
}