|
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Linq; |
4 | 4 | using System.Threading.Tasks; |
| 5 | +using Example.ASPBlazor.Data; |
5 | 6 | using Microsoft.AspNetCore.Builder; |
6 | 7 | using Microsoft.AspNetCore.Components; |
7 | 8 | using Microsoft.AspNetCore.Hosting; |
8 | 9 | using Microsoft.AspNetCore.HttpsPolicy; |
9 | 10 | using Microsoft.Extensions.Configuration; |
10 | 11 | using Microsoft.Extensions.DependencyInjection; |
11 | 12 | using Microsoft.Extensions.Hosting; |
12 | | -using Example.ASPBlazor.Data; |
13 | 13 |
|
14 | 14 | namespace Example.ASPBlazor |
15 | 15 | { |
16 | | - public class Startup |
| 16 | + public class Startup |
| 17 | + { |
| 18 | + public Startup(IConfiguration configuration) |
17 | 19 | { |
18 | | - public Startup(IConfiguration configuration) |
19 | | - { |
20 | | - Configuration = configuration; |
21 | | - } |
| 20 | + Configuration = configuration; |
| 21 | + } |
22 | 22 |
|
23 | | - public IConfiguration Configuration { get; } |
| 23 | + public IConfiguration Configuration { get; } |
24 | 24 |
|
25 | | - // This method gets called by the runtime. Use this method to add services to the container. |
26 | | - // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 |
27 | | - public void ConfigureServices(IServiceCollection services) |
28 | | - { |
29 | | - services.AddRazorPages(); |
30 | | - services.AddServerSideBlazor(); |
31 | | - services.AddSingleton<WeatherForecastService>(); |
32 | | - } |
| 25 | + // This method gets called by the runtime. Use this method to add services to the container. |
| 26 | + // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 |
| 27 | + public void ConfigureServices(IServiceCollection services) |
| 28 | + { |
| 29 | + services.AddRazorPages(); |
| 30 | + services.AddServerSideBlazor(); |
| 31 | + services.AddSingleton<WeatherForecastService>(); |
| 32 | + } |
33 | 33 |
|
34 | | - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. |
35 | | - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
36 | | - { |
37 | | - if (env.IsDevelopment()) |
38 | | - { |
39 | | - app.UseDeveloperExceptionPage(); |
40 | | - } |
41 | | - else |
42 | | - { |
43 | | - app.UseExceptionHandler("/Error"); |
44 | | - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. |
45 | | - app.UseHsts(); |
46 | | - } |
| 34 | + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. |
| 35 | + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
| 36 | + { |
| 37 | + if (env.IsDevelopment()) |
| 38 | + { |
| 39 | + app.UseDeveloperExceptionPage(); |
| 40 | + } |
| 41 | + else |
| 42 | + { |
| 43 | + app.UseExceptionHandler("/Error"); |
| 44 | + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. |
| 45 | + app.UseHsts(); |
| 46 | + } |
47 | 47 |
|
48 | | - app.UseHttpsRedirection(); |
49 | | - app.UseStaticFiles(); |
| 48 | + app.UseHttpsRedirection(); |
| 49 | + app.UseStaticFiles(); |
50 | 50 |
|
51 | | - app.UseRouting(); |
| 51 | + app.UseRouting(); |
52 | 52 |
|
53 | | - app.UseEndpoints(endpoints => |
54 | | - { |
55 | | - endpoints.MapBlazorHub(); |
56 | | - endpoints.MapFallbackToPage("/_Host"); |
57 | | - }); |
58 | | - } |
| 53 | + app.UseEndpoints(endpoints => |
| 54 | + { |
| 55 | + endpoints.MapBlazorHub(); |
| 56 | + endpoints.MapFallbackToPage("/_Host"); |
| 57 | + }); |
59 | 58 | } |
| 59 | + } |
60 | 60 | } |
0 commit comments