Skip to content

Commit aacc42e

Browse files
authored
Blazor movie db sample 9.0 updates (#395)
1 parent f8c681d commit aacc42e

19 files changed

+41
-57
lines changed

9.0/BlazorWebAppMovies/.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"dotnet-ef": {
6-
"version": "8.0.7",
6+
"version": "9.0.0",
77
"commands": [
88
"dotnet-ef"
99
],
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.11.35017.193
4+
VisualStudioVersion = 17.13.35507.96 d17.13
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorWebAppMovies", "BlazorWebAppMovies.csproj", "{479B0EE4-B630-471F-B978-C6F151411267}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorWebAppMovies", "BlazorWebAppMovies.csproj", "{CBD0A073-A91F-4D3B-B944-7FE075360187}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{479B0EE4-B630-471F-B978-C6F151411267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{479B0EE4-B630-471F-B978-C6F151411267}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{479B0EE4-B630-471F-B978-C6F151411267}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{479B0EE4-B630-471F-B978-C6F151411267}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{CBD0A073-A91F-4D3B-B944-7FE075360187}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{CBD0A073-A91F-4D3B-B944-7FE075360187}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{CBD0A073-A91F-4D3B-B944-7FE075360187}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{CBD0A073-A91F-4D3B-B944-7FE075360187}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {5C56671E-3719-47B0-B877-BB852A8290E8}
23+
SolutionGuid = {CC1651A4-7652-4C58-A1EB-CD1C58C5A574}
2424
EndGlobalSection
2525
EndGlobal

9.0/BlazorWebAppMovies/Components/Layout/MainLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</main>
1717
</div>
1818

19-
<div id="blazor-error-ui">
19+
<div id="blazor-error-ui" data-nosnippet>
2020
An unhandled error has occurred.
2121
<a href="." class="reload">Reload</a>
2222
<span class="dismiss">🗙</span>

9.0/BlazorWebAppMovies/Components/Layout/NavMenu.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
88

99
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
10-
<nav class="flex-column">
10+
<nav class="nav flex-column">
1111
<div class="nav-item px-3">
1212
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
1313
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home

9.0/BlazorWebAppMovies/Components/Layout/NavMenu.razor.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
.top-row {
19-
height: 3.5rem;
19+
min-height: 3.5rem;
2020
background-color: rgba(0,0,0,0.4);
2121
}
2222

9.0/BlazorWebAppMovies/Components/Pages/MoviePages/Create.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="col-md-4">
1515
<EditForm method="post" Model="Movie" OnValidSubmit="AddMovie" FormName="create" Enhance>
1616
<DataAnnotationsValidator />
17-
<ValidationSummary class="text-danger" />
17+
<ValidationSummary class="text-danger" role="alert"/>
1818
<div class="mb-3">
1919
<label for="title" class="form-label">Title:</label>
2020
<InputText id="title" @bind-Value="Movie.Title" class="form-control" />

9.0/BlazorWebAppMovies/Components/Pages/MoviePages/Edit.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@page "/Movies/edit"
1+
@page "/movies/edit"
22
@using Microsoft.EntityFrameworkCore
33
@using BlazorWebAppMovies.Models
44
@inject IDbContextFactory<BlazorWebAppMovies.Data.BlazorWebAppMoviesContext> DbFactory
@@ -20,7 +20,7 @@ else
2020
<div class="col-md-4">
2121
<EditForm method="post" Model="Movie" OnValidSubmit="UpdateMovie" FormName="edit" Enhance>
2222
<DataAnnotationsValidator />
23-
<ValidationSummary />
23+
<ValidationSummary role="alert"/>
2424
<input type="hidden" name="Movie.Id" value="@Movie.Id" />
2525
<div class="mb-3">
2626
<label for="title" class="form-label">Title:</label>

9.0/BlazorWebAppMovies/Components/Pages/MoviePages/Index.razor

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
@using Microsoft.AspNetCore.Components.QuickGrid
55
@using BlazorWebAppMovies.Models
66
@using BlazorWebAppMovies.Data
7-
@inject IDbContextFactory<BlazorWebAppMovies.Data.BlazorWebAppMoviesContext> DbFactory
87
@implements IAsyncDisposable
8+
@inject IDbContextFactory<BlazorWebAppMovies.Data.BlazorWebAppMoviesContext> DbFactory
99

1010
<PageTitle>Index</PageTitle>
1111

1212
<h1>Index</h1>
1313

14-
<p>
14+
<div>
1515
<input type="search" @bind="titleFilter" @bind:event="oninput" />
16-
</p>
16+
</div>
1717

1818
<p>
1919
<a href="movies/create">Create New</a>
@@ -36,17 +36,17 @@
3636
<Paginator State="pagination" />
3737

3838
@code {
39+
private BlazorWebAppMoviesContext context = default!;
3940
private PaginationState pagination = new PaginationState { ItemsPerPage = 10 };
4041
private string titleFilter = string.Empty;
41-
private BlazorWebAppMoviesContext context = default!;
42+
43+
private IQueryable<Movie> FilteredMovies =>
44+
context.Movie.Where(m => m.Title!.Contains(titleFilter));
4245

4346
protected override void OnInitialized()
4447
{
4548
context = DbFactory.CreateDbContext();
4649
}
4750

48-
private IQueryable<Movie> FilteredMovies =>
49-
context.Movie.Where(m => m.Title!.Contains(titleFilter));
50-
5151
public async ValueTask DisposeAsync() => await context.DisposeAsync();
5252
}

9.0/BlazorWebAppMovies/Components/Pages/Weather.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ else
1717
<thead>
1818
<tr>
1919
<th>Date</th>
20-
<th>Temp. (C)</th>
21-
<th>Temp. (F)</th>
20+
<th aria-label="Temperature in Celsius">Temp. (C)</th>
21+
<th aria-label="Temperature in Farenheit">Temp. (F)</th>
2222
<th>Summary</th>
2323
</tr>
2424
</thead>

9.0/BlazorWebAppMovies/Migrations/20240712174951_InitialCreate.Designer.cs renamed to 9.0/BlazorWebAppMovies/Migrations/20241114143216_InitialCreate.Designer.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)