Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(
            IApplicationBuilder app,
            IHostingEnvironment env,
            AppContext appContext,
            BankingDbContext bankingDbContext,
            MarketingDbContext marketingDbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();

            appContext.Seed().Wait();

            // Normally I shouldn't need these extra Seed methods
            // But somehow UseInMemoryDatabase won't let me share data across contexts
            bankingDbContext.Seed().Wait();
            marketingDbContext.Seed().Wait();
        }