Autofac 解析 生命周期作用域
解析注册完成后,可以从创建的容器或生命周期中解析服务 用Resolve方法实现:var builder = new ContainerBuilder();builder.RegisterType<MyComponent>().As<IService>();var container = builder.Build();using(var scope = container.BeginLifetimeScope()){ var servic