using Autofac;
|
using Microsoft.AspNetCore.Http;
|
using Operater.Service.System;
|
using System;
|
using System.Collections.Generic;
|
using System.Text;
|
|
namespace Operater.Service
|
{
|
public class ServiceModule : Module
|
{
|
protected override void Load(ContainerBuilder builder)
|
{
|
builder.RegisterType<HttpContextAccessor>().As<IHttpContextAccessor>().PropertiesAutowired();
|
var service = AppDomain.CurrentDomain.Load("Operater.Service");
|
|
//builder.RegisterGeneric(typeof(BaseService<>))
|
// .As(typeof(IBaseService<>))
|
// .InstancePerLifetimeScope();
|
|
builder.RegisterAssemblyTypes(service)
|
//.Where(t => typeof(IDependencyInjection).IsAssignableFrom(t))
|
.InstancePerLifetimeScope()
|
.AsImplementedInterfaces();
|
}
|
|
}
|
}
|