internal static void ConfigureDatabaseMigrations(itwazzupDbContext context) { //Check if there are any pending migrations if (context.Database.GetPendingMigrations().Any()) { context.Database.Migrate(); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, itwazzupDbContext context) { Console.WriteLine("Current Environment"); Console.WriteLine(env.EnvironmentName); app.UseCors("CORSPolicy"); ConfigureSwagger(app); ConfigureMvc(app); ConfigureDatabaseMigrations(context); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); SeedDatabase(context); } }
public QueryHandler(itwazzupDbContext itwazzupDbContext) { this.itwazzupDbContext = itwazzupDbContext; }
internal static void SeedDatabase(itwazzupDbContext context) { }
public CommandHandler(itwazzupDbContext dbContext) { this.dbContext = dbContext; }
public QueryHandler(itwazzupDbContext dbContext) { this.dbContext = dbContext; }