예제 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              ILoggerFactory loggerFactory, BonbonniereContext bonbonniereContext, ThirdPartyContext thirdPartyContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Add the authentication middleware to the pipeline
            app.UseAuthentication();

            app.UseCors("AllowSpecificOrigin");

            //app.UseBasicAuthenticationMiddleware();

            app.UseSwagger();

            app.UseSwaggerUI(sg =>
            {
                sg.SwaggerEndpoint($"/swagger/{_ApiVersion}/swagger.json", $"{_Project_Name} {_ApiVersion}");
                sg.ShowRequestHeaders();
            });

            //app.UseStaticFiles();
            //app.UseStatusCodePages();

            app.UseMvc();

            bonbonniereContext.Initialize();
            thirdPartyContext.Initialize();
        }
예제 #2
0
 public BookService(BonbonniereContext context)
 {
     _context = context;
 }