[csharp] startup

Viewer

  1. public IConfiguration Configuration { get; }
  2.  
  3.         // This method gets called by the runtime. Use this method to add services to the container.
  4.         public void ConfigureServices(IServiceCollection services)
  5.         {
  6.             services.AddControllersWithViews();
  7.  
  8.         }
  9.  
  10.         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
  11.         public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
  12.         {
  13.             if (env.IsDevelopment())
  14.             {
  15.                 app.UseDeveloperExceptionPage();
  16.             }
  17.             else
  18.             {
  19.                 app.UseExceptionHandler("/Home/Error");
  20.                 // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
  21.                 app.UseHsts();
  22.             }
  23.             app.UseHttpsRedirection();
  24.             app.UseStaticFiles();
  25.  
  26.             app.UseRouting();
  27.  
  28.             app.UseAuthorization();
  29.  
  30.             app.UseEndpoints(endpoints =>
  31.             {
  32.                 endpoints.MapControllerRoute(
  33.                     name: "default",
  34.                     pattern: "{controller=Home}/{action=Particulier}/{id?}");
  35.             });
  36.         }

Editor

You can edit this paste and save as new:


File Description
  • startup
  • Paste Code
  • 17 Feb-2020
  • 1.27 Kb
You can Share it: