// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, QuizDITDbContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseSwagger();
                app.UseSwaggerUI(c =>
                {
                    c.SwaggerEndpoint("/swagger/v1/swagger.json", "Quiz DIT Managment Service 1.0");
                });
            }
            app.UseCors("AllowAll");

            app.UseMvc();

            InitializeDb.LoadQuiz(context);
            InitializeDb.LoadAnswers(context);
            InitializeDb.LoadQuestions(context);
            InitializeDb.LoadQuestionMappings(context);
            InitializeDb.LoadQuestionAnswerMappings(context);
            InitializeDb.LoadUsers(context);
            InitializeDb.LoadUserQuiz(context);
        }
Exemple #2
0
 public QuizController(IServiceProvider serviceProvider, QuizDITDbContext context)
     : base(serviceProvider)
 {
     _context = context;
 }