File tree Expand file tree Collapse file tree 10 files changed +8
-76
lines changed Expand file tree Collapse file tree 10 files changed +8
-76
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99
1010<p >This component demonstrates fetching data from a service.</p >
1111
12- @if (Forecasts == null )
12+ @if (forecasts == null )
1313{
1414 <p ><em >Loading .. .</em ></p >
1515}
2525 </tr >
2626 </thead >
2727 <tbody >
28- @foreach ( var forecast in Forecasts )
28+ @foreach ( var forecast in forecasts )
2929 {
3030 <tr >
3131 <td >@forecast.Date.ToShortDateString() </td >
3939}
4040
4141@code {
42- [ SupplyParameterFromPersistentComponentState ] public WeatherForecast []? Forecasts { get ; set ; }
42+ WeatherForecast []? forecasts ;
4343
4444 protected override async Task OnInitializedAsync ()
4545 {
46- if (Forecasts == null )
47- {
48- Forecasts = await ForecastService .GetForecastAsync (DateTime .Now );
49- }
46+ forecasts = await ForecastService .GetForecastAsync (DateTime .Now );
5047 }
5148}
Original file line number Diff line number Diff line change 11@page " /"
2- @inject Data .SamplePersistentService Service
3- @inject AntiforgeryStateProvider AntiforgeryStateProvider
42
53<PageTitle >Index</PageTitle >
64
75<h1 >Hello, world!</h1 >
86
9- <button id =" start-blazor" onclick =" start()" >Start Blazor!</button >
10-
11- <p >Service state: @Service.SampleState </p >
12-
13- <p >Antifoguerty @AntiforgeryStateProvider.GetAntiforgeryToken() ?.Value</p >
14-
15- @for ( var i = 0 ; i < 10 ; i ++ )
16- {
17- var current = i ;
18-
19- <StatefulComponent @key =" current" InitialValue =" @Guid.NewGuid()" />
20- }
21-
22- @code {
23- protected override void OnInitialized ()
24- {
25- Service .SampleState ??= Guid .NewGuid ().ToString ();
26- }
27- }
7+ Welcome to your new app.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 77}
88
99<app ><component type =" typeof(App)" render-mode =" ServerPrerendered" /></app >
10-
11- <persist-component-state />
Original file line number Diff line number Diff line change 1717 @RenderBody()
1818
1919 <script src =" _framework/blazor.server.js" autostart =" false" ></script >
20-
21- <script type =" module" >
22- window .start = async function start (){
23- await Blazor .start ({
20+ <script >
21+ Blazor .start ({
2422 logLevel: 1 , // LogLevel.Debug
2523 configureSignalR : builder => builder .configureLogging (" debug" ) // LogLevel.Debug
2624 });
27- document .getElementById (" start-blazor" ).remove ();
28- }
2925 </script >
3026</body >
3127</html >
Original file line number Diff line number Diff line change 1111 "BlazorServerApp" : {
1212 "commandName" : " Project" ,
1313 "launchBrowser" : true ,
14- "launchUrl" : " https://localhost:5001/" ,
1514 "environmentVariables" : {
1615 "ASPNETCORE_ENVIRONMENT" : " Development"
1716 },
Original file line number Diff line number Diff line change 22// The .NET Foundation licenses this file to you under the MIT license.
33
44using BlazorServerApp . Data ;
5- using Microsoft . AspNetCore . Components ;
6- using Microsoft . AspNetCore . Components . Authorization ;
7- using Microsoft . AspNetCore . Components . Web ;
85
96namespace BlazorServerApp ;
107
@@ -23,8 +20,6 @@ public void ConfigureServices(IServiceCollection services)
2320 {
2421 services . AddRazorPages ( ) ;
2522 services . AddServerSideBlazor ( ) ;
26- services . AddScoped < SamplePersistentService > ( ) ;
27- services . AddPersistentService < SamplePersistentService > ( RenderMode . InteractiveServer ) ;
2823 services . AddSingleton < WeatherForecastService > ( ) ;
2924 }
3025
Original file line number Diff line number Diff line change 2222 // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
2323 app . UseHsts ( ) ;
2424}
25- else
26- {
27- app . UseWebAssemblyDebugging ( ) ;
28- }
2925
3026app . UseHttpsRedirection ( ) ;
3127
Original file line number Diff line number Diff line change 2323 "dotnetRunMessages" : true ,
2424 "launchBrowser" : true ,
2525 "applicationUrl" : " https://localhost:7247;http://localhost:5265" ,
26- "inspectUri" : " {wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" ,
26+ // "inspectUri": "{wsProtocol }://{url.hostname }:{url.port }/_framework/debug/ws-proxy?browser={browserInspectUri}",
2727 "environmentVariables" : {
2828 "ASPNETCORE_ENVIRONMENT" : " Development"
2929 }
You can’t perform that action at this time.
0 commit comments