Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.28 KB | None | 0 0
  1.     public class Startup
  2.     {
  3.         public Startup(IConfiguration configuration)
  4.         {
  5.             Configuration = configuration;
  6.         }
  7.  
  8.         public IConfiguration Configuration { get; }
  9.  
  10.         // This method gets called by the runtime. Use this method to add services to the container.
  11.         public void ConfigureServices(IServiceCollection services)
  12.         {
  13.             services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
  14.         }
  15.  
  16.         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
  17.         public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  18.         {
  19.             if (env.IsDevelopment())
  20.             {
  21.                 app.UseDeveloperExceptionPage();
  22.             }
  23.             else
  24.             {
  25.                 app.UseHsts();
  26.                 app.UseHttpsRedirection();
  27.             }
  28.  
  29.             app.UseMvc();
  30.         }
  31.     }
  32.  
  33.     public class Program
  34.     {
  35.         public static void Main(string[] args)
  36.         {
  37.             CreateWebHostBuilder(args).Build().Run();
  38.         }
  39.  
  40.         public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
  41.             WebHost.CreateDefaultBuilder(args)
  42.                 .UseStartup<Startup>();
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement