Skip to content

Commit 9a2ea0c

Browse files
committed
Undo sample changes
1 parent 46b97eb commit 9a2ea0c

File tree

10 files changed

+8
-76
lines changed

10 files changed

+8
-76
lines changed

src/Components/Samples/BlazorServerApp/Data/SamplePersistentService.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Components/Samples/BlazorServerApp/Pages/FetchData.razor

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
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
}
@@ -25,7 +25,7 @@ else
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>
@@ -39,13 +39,10 @@ else
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
}
Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
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.

src/Components/Samples/BlazorServerApp/Pages/StatefulComponent.razor

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Components/Samples/BlazorServerApp/Pages/_Host.cshtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@
77
}
88

99
<app><component type="typeof(App)" render-mode="ServerPrerendered"/></app>
10-
11-
<persist-component-state />

src/Components/Samples/BlazorServerApp/Pages/_Layout.cshtml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@
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>

src/Components/Samples/BlazorServerApp/Properties/launchSettings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"BlazorServerApp": {
1212
"commandName": "Project",
1313
"launchBrowser": true,
14-
"launchUrl": "https://localhost:5001/",
1514
"environmentVariables": {
1615
"ASPNETCORE_ENVIRONMENT": "Development"
1716
},

src/Components/Samples/BlazorServerApp/Startup.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using BlazorServerApp.Data;
5-
using Microsoft.AspNetCore.Components;
6-
using Microsoft.AspNetCore.Components.Authorization;
7-
using Microsoft.AspNetCore.Components.Web;
85

96
namespace 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

src/Components/Samples/BlazorUnitedApp/Program.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
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

3026
app.UseHttpsRedirection();
3127

src/Components/Samples/BlazorUnitedApp/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
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
}

0 commit comments

Comments
 (0)