Startup.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.Builder;
  6. using Microsoft.AspNetCore.Hosting;
  7. using Microsoft.AspNetCore.Mvc;
  8. using Microsoft.Extensions.Configuration;
  9. using Microsoft.Extensions.DependencyInjection;
  10. using Microsoft.Extensions.Logging;
  11. using Microsoft.Extensions.Options;
  12. namespace ServiceConsumer
  13. {
  14. public class Startup
  15. {
  16. public Startup(IConfiguration configuration)
  17. {
  18. Configuration = configuration;
  19. }
  20. public IConfiguration Configuration { get; }
  21. // This method gets called by the runtime. Use this method to add services to the container.
  22. public void ConfigureServices(IServiceCollection services)
  23. {
  24. services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
  25. }
  26. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
  27. public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  28. {
  29. if (env.IsDevelopment())
  30. {
  31. app.UseDeveloperExceptionPage();
  32. }
  33. app.UseMvc();
  34. }
  35. }
  36. }