Пример #1
0
 internal static void ConfigureDatabaseMigrations(itwazzupDbContext context)
 {
     //Check if there are any pending migrations
     if (context.Database.GetPendingMigrations().Any())
     {
         context.Database.Migrate();
     }
 }
Пример #2
0
        // 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);
            }
        }
Пример #3
0
 public QueryHandler(itwazzupDbContext itwazzupDbContext)
 {
     this.itwazzupDbContext = itwazzupDbContext;
 }
Пример #4
0
 internal static void SeedDatabase(itwazzupDbContext context)
 {
 }
Пример #5
0
 public CommandHandler(itwazzupDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Пример #6
0
 public QueryHandler(itwazzupDbContext dbContext)
 {
     this.dbContext = dbContext;
 }