Skip to content

Commit 6271103

Browse files
authored
Update samples for correct architectural patterns (#636)
1 parent 4f0a14d commit 6271103

235 files changed

Lines changed: 694 additions & 685 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10.0/BlazorWebAppEntra/BlazorWebAppEntra.Client/Weather/WeatherForecast.cs

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

10.0/BlazorWebAppEntra/BlazorWebAppEntra.sln

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

10.0/BlazorWebAppEntra/BlazorWebAppEntra/LoginLogoutEndpointRouteBuilderExtensions.cs

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

10.0/BlazorWebAppEntra/BlazorWebAppEntra/Properties/launchSettings.json

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

10.0/BlazorWebAppEntra/README.md

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

10.0/BlazorWebAppEntraBff/BlazorWebAppEntra.Client/Layout/LogInOrOut.razor

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@
2525

2626
protected override void OnInitialized()
2727
{
28-
currentUrl = Navigation.ToBaseRelativePath(Navigation.Uri);
28+
currentUrl = Navigation.Uri;
2929
Navigation.LocationChanged += OnLocationChanged;
3030
}
3131

3232
private void OnLocationChanged(object? sender, LocationChangedEventArgs e)
3333
{
34-
currentUrl = Navigation.ToBaseRelativePath(e.Location);
34+
currentUrl = Navigation.Uri;
3535
StateHasChanged();
3636
}
3737

38-
public void Dispose()
39-
{
40-
Navigation.LocationChanged -= OnLocationChanged;
41-
}
38+
public void Dispose() => Navigation.LocationChanged -= OnLocationChanged;
4239
}

10.0/BlazorWebAppEntraBff/BlazorWebAppEntra.Client/Layout/LogInOrOut.razor.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
.nav-item {
2020
font-size: 0.9rem;
2121
padding-bottom: 0.5rem;
22+
text-align: left;
2223
}
2324

2425
.nav-item .nav-link {
@@ -29,7 +30,7 @@
2930
height: 3rem;
3031
display: flex;
3132
align-items: center;
32-
line-height: 3rem;
33+
text-align: left;
3334
width: 100%;
3435
}
3536

10.0/BlazorWebAppEntraBff/BlazorWebAppEntra.Client/Pages/UserClaims.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@page "/user-claims"
1+
@page "/user-claims"
22
@using System.Security.Claims
33
@using Microsoft.AspNetCore.Authorization
44
@attribute [Authorize]
@@ -18,7 +18,7 @@
1818
}
1919

2020
@code {
21-
private IEnumerable<Claim> claims = Enumerable.Empty<Claim>();
21+
private IEnumerable<Claim> claims = [];
2222

2323
[CascadingParameter]
2424
private Task<AuthenticationState>? AuthState { get; set; }

10.0/BlazorWebAppEntraBff/BlazorWebAppEntra.Client/Pages/Weather.razor

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<p>This component demonstrates showing data.</p>
1212

13-
@if (forecasts == null)
13+
@if (Forecasts == null)
1414
{
1515
<p><em>Loading...</em></p>
1616
}
@@ -20,13 +20,13 @@ else
2020
<thead>
2121
<tr>
2222
<th>Date</th>
23-
<th>Temp. (C)</th>
24-
<th>Temp. (F)</th>
23+
<th aria-label="Temperature in Celsius">Temp. (C)</th>
24+
<th aria-label="Temperature in Fahrenheit">Temp. (F)</th>
2525
<th>Summary</th>
2626
</tr>
2727
</thead>
2828
<tbody>
29-
@foreach (var forecast in forecasts)
29+
@foreach (var forecast in Forecasts)
3030
{
3131
<tr>
3232
<td>@forecast.Date.ToShortDateString()</td>
@@ -40,10 +40,11 @@ else
4040
}
4141

4242
@code {
43-
private IEnumerable<WeatherForecast>? forecasts;
43+
[PersistentState]
44+
public IEnumerable<WeatherForecast>? Forecasts { get; set; }
4445

4546
protected override async Task OnInitializedAsync()
4647
{
47-
forecasts = await WeatherForecaster.GetWeatherForecastAsync();
48+
Forecasts ??= await WeatherForecaster.GetWeatherForecastAsync();
4849
}
4950
}

10.0/BlazorWebAppEntraBff/BlazorWebAppEntra.Client/Weather/IWeatherForecaster.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
namespace BlazorWebAppEntra.Client.Weather;
32

43
public interface IWeatherForecaster

0 commit comments

Comments
 (0)