添加项目文件。
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using AdminService.System;
|
||||
using AdminService.Customer;
|
||||
using AdminService.Admin;
|
||||
using Autofac;
|
||||
using CommonService;
|
||||
using MongoRepository;
|
||||
using UserService;
|
||||
using UserService.BeautifulNumber;
|
||||
|
||||
namespace AdminHost.Middleware
|
||||
{
|
||||
public class AutofacModule : Module
|
||||
{
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
builder.RegisterGeneric(typeof(MongoBaseRepository<>)).As(typeof(IMongoBaseRepository<>)).InstancePerLifetimeScope();
|
||||
|
||||
builder.RegisterType<RedisService.RedisService>()
|
||||
.As<RedisService.IRedisService>()
|
||||
.InstancePerLifetimeScope();
|
||||
|
||||
builder.RegisterAssemblyTypes(typeof(ApiLogService).Assembly)
|
||||
.Where(t => t.Name.EndsWith("Service"))
|
||||
.AsImplementedInterfaces()
|
||||
.InstancePerLifetimeScope();
|
||||
|
||||
builder.RegisterAssemblyTypes(typeof(AdminOperationLogService).Assembly)
|
||||
.Where(t => t.Name.EndsWith("Service"))
|
||||
.AsImplementedInterfaces()
|
||||
.InstancePerLifetimeScope();
|
||||
|
||||
builder.RegisterAssemblyTypes(typeof(SystemService).Assembly)
|
||||
.Where(t => t.Name.EndsWith("Service"))
|
||||
.AsImplementedInterfaces()
|
||||
.InstancePerLifetimeScope();
|
||||
|
||||
builder.RegisterAssemblyTypes(typeof(UserFeedbackService).Assembly)
|
||||
.Where(t => t.Name.EndsWith("Service"))
|
||||
.AsImplementedInterfaces()
|
||||
.InstancePerLifetimeScope();
|
||||
|
||||
builder.RegisterType<CommonService.BackgroundOperationService>()
|
||||
.As<CommonService.IBackgroundOperationService>()
|
||||
.InstancePerLifetimeScope();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user