File tree Expand file tree Collapse file tree 4 files changed +8
-22
lines changed
src/Components/Samples/BlazorUnitedApp Expand file tree Collapse file tree 4 files changed +8
-22
lines changed Original file line number Diff line number Diff line change 1414 <HeadOutlet />
1515</head >
1616<body >
17- <Routes @rendermode = " InteractiveServer " />
17+ <Routes />
1818 <script src =" @Assets[" _framework /blazor.web.js " ]" ></script >
19- <ReconnectModal />
2019</body >
2120</html >
Original file line number Diff line number Diff line change 88
99<p >This component demonstrates fetching data from a service.</p >
1010
11- @if (Forecasts == null )
11+ @if (forecasts == null )
1212{
1313 <p ><em >Loading .. .</em ></p >
1414}
2424 </tr >
2525 </thead >
2626 <tbody >
27- @foreach ( var forecast in Forecasts )
27+ @foreach ( var forecast in forecasts )
2828 {
2929 <tr >
3030 <td >@forecast.Date.ToShortDateString() </td >
3838}
3939
4040@code {
41- [ SupplyParameterFromPersistentComponentState ] public WeatherForecast [] Forecasts { get ; set ; } = null ! ;
41+ private WeatherForecast []? forecasts ;
4242
4343 protected override async Task OnInitializedAsync ()
4444 {
45- Forecasts ?? = await ForecastService .GetForecastAsync (DateOnly .FromDateTime (DateTime .Now ));
45+ forecasts = await ForecastService .GetForecastAsync (DateOnly .FromDateTime (DateTime .Now ));
4646 }
4747}
Original file line number Diff line number Diff line change 33
44using BlazorUnitedApp ;
55using BlazorUnitedApp . Data ;
6- using Microsoft . AspNetCore . Components . Server . Circuits ;
7- using Microsoft . Extensions . DependencyInjection . Extensions ;
86
97var builder = WebApplication . CreateBuilder ( args ) ;
108
119// Add services to the container.
1210builder . Services . AddRazorComponents ( )
1311 . AddInteractiveWebAssemblyComponents ( )
14- . AddInteractiveServerComponents ( o => o . DisconnectedCircuitMaxRetained = 0 ) ;
12+ . AddInteractiveServerComponents ( ) ;
1513
1614builder . Services . AddSingleton < WeatherForecastService > ( ) ;
1715
18- //builder.Services.TryAddEnumerable(ServiceDescriptor.Scoped<CircuitHandler, CustomCircuitHandler>());
19-
2016var app = builder . Build ( ) ;
2117
2218// Configure the HTTP request pipeline.
3834 . AddInteractiveWebAssemblyRenderMode ( ) ;
3935
4036app . Run ( ) ;
41-
42- public class CustomCircuitHandler : CircuitHandler
43- {
44- public override async Task OnConnectionUpAsync ( Circuit circuit , CancellationToken cancellationToken )
45- {
46- await Task . Delay ( 1000 , cancellationToken ) ; // Simulate some async work
47- circuit . PauseCircuit ( ) ;
48- }
49- }
Original file line number Diff line number Diff line change 1313 "dotnetRunMessages" : true ,
1414 "launchBrowser" : true ,
1515 "applicationUrl" : " http://localhost:5265" ,
16- // "inspectUri": "{wsProtocol }://{url.hostname }:{url.port }/_framework/debug/ws-proxy?browser={browserInspectUri}",
16+ "inspectUri" : " {wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" ,
1717 "environmentVariables" : {
1818 "ASPNETCORE_ENVIRONMENT" : " Development"
1919 }
2222 "commandName" : " Project" ,
2323 "dotnetRunMessages" : true ,
2424 "launchBrowser" : true ,
25- "applicationUrl" : " http ://localhost:7247;http://localhost:5265" ,
25+ "applicationUrl" : " https ://localhost:7247;http://localhost:5265" ,
2626 //"inspectUri": "{wsProtocol }://{url.hostname }:{url.port }/_framework/debug/ws-proxy?browser={browserInspectUri}",
2727 "environmentVariables" : {
2828 "ASPNETCORE_ENVIRONMENT" : " Development"
You can’t perform that action at this time.
0 commit comments