Skip to content

Commit 4f0a14d

Browse files
authored
Updates to the 10.0 movie dB tutorial sample (#638)
1 parent a7f9806 commit 4f0a14d

16 files changed

Lines changed: 37 additions & 46 deletions

10.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": "10.0.0",
6+
"version": "10.0.1",
77
"commands": [
88
"dotnet-ef"
99
],

10.0/BlazorWebAppMovies/BlazorWebAppMovies.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter" Version="10.0.0" />
1212
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.0" />
1313
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.0" />
14-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0" />
15-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="10.0.0-rc.1.25458.5" />
14+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0">
15+
<PrivateAssets>all</PrivateAssets>
16+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
17+
</PackageReference>
18+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="10.0.0" />
1619
</ItemGroup>
1720

1821
</Project>

10.0/BlazorWebAppMovies/BlazorWebAppMovies.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="BlazorWebAppMovies.csproj" />
3+
</Solution>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151

5252
@code {
5353
[SupplyParameterFromForm]
54-
private Movie Movie { get; set; } = new();
54+
private Movie Movie { get; set; } = default!;
55+
56+
protected override void OnInitialized() => Movie ??= new();
5557

5658
// To protect from overposting attacks, see https://learn.microsoft.com/aspnet/core/blazor/forms/#mitigate-overposting-attacks.
5759
private async Task AddMovie()

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,14 @@
3838
<Paginator State="pagination" />
3939

4040
@code {
41+
private BlazorWebAppMoviesContext context = default!;
42+
private PaginationState pagination = new PaginationState { ItemsPerPage = 5 };
43+
4144
private string titleFilter = string.Empty;
4245

4346
private IQueryable<Movie> FilteredMovies =>
4447
context.Movie.Where(m => m.Title!.Contains(titleFilter));
4548

46-
private BlazorWebAppMoviesContext context = default!;
47-
48-
private PaginationState pagination = new PaginationState { ItemsPerPage = 5 };
49-
5049
protected override void OnInitialized()
5150
{
5251
context = DbFactory.CreateDbContext();
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
@page "/not-found"
1+
2+
3+
@page "/not-found"
24
@layout MainLayout
35

4-
<h3>Not Found</h3>
5-
<p>Sorry, the content you are looking for does not exist.</p>
6+
7+
<PageTitle>Not Found</PageTitle>
8+
9+
10+
<h1>Not Found</h1>
11+
<p>Sorry, there's nothing at this address.</p>
12+
13+
14+
<a href="/">Back to Home</a>

10.0/BlazorWebAppMovies/Migrations/20251113170644_InitialCreate.Designer.cs renamed to 10.0/BlazorWebAppMovies/Migrations/20251212160348_InitialCreate.Designer.cs

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

10.0/BlazorWebAppMovies/Migrations/20251113170644_InitialCreate.cs renamed to 10.0/BlazorWebAppMovies/Migrations/20251212160348_InitialCreate.cs

File renamed without changes.

10.0/BlazorWebAppMovies/Migrations/20251113174810_NewMovieDataAnnotations.Designer.cs renamed to 10.0/BlazorWebAppMovies/Migrations/20251212162449_NewMovieDataAnnotations.Designer.cs

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

0 commit comments

Comments
 (0)