コード例 #1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }

            app.UseSwagger();

            app.UseSwaggerUI(options =>
                             options.SwaggerEndpoint("/swagger/v1/swagger.json", "Conference Planner API v1")
                             );

            app.UseMvc();

            app.Run(context =>
            {
                context.Response.Redirect("/swagger");
                return(Task.CompletedTask);
            });

            // Comment out the following line to avoid resetting the database each time
            NDCSydneyData.Seed(app.ApplicationServices);
        }
コード例 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            // Comment out the following line to avoid resetting the database each time
            NDCSydneyData.Seed(app.ApplicationServices);

            app.UseSwagger();

            app.UseSwaggerUI(options =>
                             options.SwaggerEndpoint("/swagger/v1/swagger.json", "Conference Planner API v1")
                             );

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();
        }
コード例 #3
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)
        {
            app.UseSwagger();

            app.UseSwaggerUI(options =>
                             options.SwaggerEndpoint("/swagger/v1/swagger.json", "Conference Planner API v1")
                             );

            app.UseMvc();

            app.Run(context =>
            {
                context.Response.Redirect("/swagger");
                return(Task.CompletedTask);
            });

            NDCSydneyData.Seed(app.ApplicationServices);
        }