Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
            services.AddDbContext <OrdersContext>(options => options.UseInMemoryDatabase("CheckoutDB"));
            var bootstrapper = new Bootstraper();

            ApplicationContainer = bootstrapper.CreateContainer(services);
            return(new AutofacServiceProvider(ApplicationContainer));
        }