Autofac 版本 2.3.2.632 中的 Autofac.Integration.Web.Mvc dll 有一个类 AutofacControllerFactory 定义为
public class AutofacControllerFactory : DefaultControllerFactory
{
public AutofacControllerFactory(IContainerProvider containerProvider);
protected override IController GetControllerInstance(RequestContext context, Type controllerType);
public override void ReleaseController(IController controller);
}
最新版本的 autofac (2.6.3.862) 没有 Autofac.Integration.Web.Mvc,而是有 Autofac.Integration.Mvc。但是这个 dll 没有 AutofacControllerFactory 类。dll Autofac.Integration.Mvc 有一个名为 AutofacDependencyResolver 的类,定义为
public class AutofacDependencyResolver : IDependencyResolver
{
public AutofacDependencyResolver(ILifetimeScope container);
public AutofacDependencyResolver(ILifetimeScope container, Action<ContainerBuilder> configurationAction);
public AutofacDependencyResolver(ILifetimeScope container, ILifetimeScopeProvider lifetimeScopeProvider);
public AutofacDependencyResolver(ILifetimeScope container, ILifetimeScopeProvider lifetimeScopeProvider, Action<ContainerBuilder> configurationAction);
public ILifetimeScope ApplicationContainer { get; }
public static AutofacDependencyResolver Current { get; }
public ILifetimeScope RequestLifetimeScope { get; }
public object GetService(Type serviceType);
public IEnumerable<object> GetServices(Type serviceType);
}
最新版本的 Autofac 中 AutofacControllerFactory 的替代品是什么?