Exemplo n.º 1
0
 public JoueursController(ProjetTp1Context context)
 {
     _context = context;
 }
 public CurrentPartieController(ProjetTp1Context context)
 {
     _context = context;
 }
 public QuestionsController(ProjetTp1Context context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public VillesController(ProjetTp1Context context)
 {
     _context = context;
 }
Exemplo n.º 5
0
 public LoginController(ProjetTp1Context context)
 {
     _context = context;
 }
Exemplo n.º 6
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ProjetTp1Context context)
        {
            try
            {
                context.Database.Migrate();
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.Print(e.ToString());
            }

            try
            {
                string script_verbe  = File.ReadAllText("Migrations/Scripts données/dbo.Verbe.data.sql");
                string script_villes = File.ReadAllText("Migrations/Scripts données/dbo.Ville.data.sql");
                if (context.Verbe.Count() < 161)
                {
                    if (context.Verbe.Count() > 0)
                    {
                        context.Database.ExecuteSqlRaw("DELETE FROM dbo.Verbe");
                    }
                    context.Database.ExecuteSqlRaw(script_verbe);
                }
                if (context.Ville.Count() < 38000)
                {
                    if (context.Ville.Count() > 0)
                    {
                        context.Database.ExecuteSqlRaw("DELETE FROM dbo.Ville");
                    }
                    context.Database.ExecuteSqlRaw(script_villes);
                }
            }
            catch
            {
            }

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();


            //begin cookies
            app.UseCookiePolicy();
            app.UseAuthentication();
            app.UseAuthorization();
            //end cookies


            app.UseEndpoints(endpoints =>
            {
                endpoints.MapBlazorHub();
                endpoints.MapFallbackToPage("/_Host");
                endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
            });
        }
Exemplo n.º 7
0
 public NoDuplicateAttribute(ProjetTp1Context context, bool type)
 {
     _context = context;
     //_pseudo = pseudo;
     _type = type;
 }
Exemplo n.º 8
0
 public PartiesController(ProjetTp1Context context)
 {
     _context = context;
 }