// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseCors(c =>
                {
                    c.AllowAnyHeader();
                    c.AllowAnyMethod();
                    c.AllowAnyOrigin();
                });
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseRouting();

            app.UseOpenApi();
            app.UseSwaggerUi3();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            using (MovieDbContext context = new MovieDbContext(Configuration.GetConnectionString("DefaultConnection")))
            {
                context.CreateDatabase();
                context.CreateTable();

                context.Database.ExecuteStoredProcedure("", new { });

                if (env.IsDevelopment())
                {
                    context.MovieGenre.Add(new MovieGenre()
                    {
                        Genre_Name = "Action", Create_At = DateTime.Now, Create_By = "Admin"
                    });
                    context.MovieGenre.Add(new MovieGenre()
                    {
                        Genre_Name = "Aventure", Create_At = DateTime.Now, Create_By = "Admin"
                    });
                    context.MovieGenre.Add(new MovieGenre()
                    {
                        Genre_Name = "Comédie", Create_At = DateTime.Now, Create_By = "Admin"
                    });
                    context.MovieGenre.Add(new MovieGenre()
                    {
                        Genre_Name = "Documentaire", Create_At = DateTime.Now, Create_By = "Admin"
                    });
                    context.MovieGenre.Add(new MovieGenre()
                    {
                        Genre_Name = "Drame", Create_At = DateTime.Now, Create_By = "Admin"
                    });
                    context.MovieGenre.Add(new MovieGenre()
                    {
                        Genre_Name = "Fantastique", Create_At = DateTime.Now, Create_By = "Admin"
                    });
                    context.MovieGenre.Add(new MovieGenre()
                    {
                        Genre_Name = "Science-fiction", Create_At = DateTime.Now, Create_By = "Admin"
                    });

                    context.Movie.Add(new Movie()
                    {
                        ID = Guid.NewGuid(), Title = "Les Gardiens de la Galaxie", TitleOriginal = "Guardians of the Galaxy", TheatricalRelease = new DateTime(2014, 08, 13), CommercialRelease = new DateTime(2014, 12, 30), Origin = "Etats-Unis", GenreID = 7, Create_At = DateTime.Now, Create_By = "Admin"
                    });
                }
            }
        }