File tree Expand file tree Collapse file tree 4 files changed +8
-34
lines changed Expand file tree Collapse file tree 4 files changed +8
-34
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ public class MongoModule: Module
13
13
{
14
14
protected override void Load ( ContainerBuilder builder )
15
15
{
16
- builder . RegisterAssemblyTypes ( ThisAssembly ) . AsImplementedInterfaces ( ) ;
17
-
18
16
builder . RegisterType < MongoDataContextService > ( ) . As < IDataContextService < MongoDataContext > > ( )
19
17
. InstancePerLifetimeScope ( ) ;
20
18
Original file line number Diff line number Diff line change 1
- using Autofac ;
1
+ using ArchitectNow . Services . Contexts ;
2
+ using Autofac ;
2
3
3
4
namespace ArchitectNow . Services
4
5
{
5
6
public class ServicesModule : Module
6
7
{
7
8
protected override void Load ( ContainerBuilder builder )
8
9
{
9
- builder . RegisterAssemblyTypes ( ThisAssembly ) . AsImplementedInterfaces ( ) ;
10
+ builder . RegisterGeneric ( typeof ( DataContextService < , > ) ) . As ( typeof ( IDataContextService < > ) ) ;
10
11
}
11
12
}
12
13
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
using ArchitectNow . Models . Security ;
2
2
using ArchitectNow . Web . Filters ;
3
+ using ArchitectNow . Web . Services ;
3
4
using Autofac ;
4
5
using Microsoft . AspNetCore . Http ;
6
+ using Microsoft . AspNetCore . Mvc ;
5
7
using Microsoft . Extensions . Configuration ;
6
8
using Microsoft . Extensions . Options ;
7
9
using Microsoft . IdentityModel . Tokens ;
@@ -12,11 +14,10 @@ public class WebModule : Module
12
14
{
13
15
protected override void Load ( ContainerBuilder builder )
14
16
{
15
- var assembly = ThisAssembly ;
16
- builder . RegisterAssemblyTypes ( assembly ) . AsImplementedInterfaces ( ) ;
17
-
17
+ builder . RegisterType < ServiceInvoker > ( ) . As < IServiceInvoker > ( ) . InstancePerLifetimeScope ( ) ;
18
+ builder . RegisterType < ExceptionResultBuilder > ( ) . As < IExceptionResultBuilder > ( ) . InstancePerLifetimeScope ( ) ;
19
+
18
20
builder . RegisterType < HttpContextAccessor > ( ) . As < IHttpContextAccessor > ( ) . SingleInstance ( ) ;
19
- builder . RegisterType < RaygunJobFilter > ( ) . AsSelf ( ) . InstancePerLifetimeScope ( ) ;
20
21
21
22
builder . RegisterType < GlobalExceptionFilter > ( ) . AsSelf ( ) . InstancePerLifetimeScope ( ) ;
22
23
You can’t perform that action at this time.
0 commit comments