コード例 #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();

            var bootStrapper = new AutofacBootStrapper();
            var builder      = bootStrapper.GetBuilder();

            builder.Populate(services);

            var container = bootStrapper.GetContainer();

            return(container.Resolve <IServiceProvider> ());
        }