Skip to content

Commit 1254ceb

Browse files
authored
Blazor movie dB tutorial updates (#34136)
1 parent c830a92 commit 1254ceb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

aspnetcore/blazor/tutorials/movie-database-app/part-3.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ The `@page` directive's route template indicates the URL for the page is `/movie
229229
* `BlazorWebAppMovies.Models`
230230
* `BlazorWebAppMovies.Data`
231231

232-
The database context factory (`IDbContextFactory<BlazorWebAppMoviesContext>`) is injected into the component with the `@inject` directive. The factory approach requires that a database context be disposed, so the component implements the <xref:System.IAsyncDisposable> interface with the `@implements` directive.
232+
The database context factory (`IDbContextFactory<T>`, where the type (`T`) is a `BlazorWebAppMoviesContext`) is injected into the component with the `@inject` directive. The factory approach requires that a database context be disposed, so the component implements the <xref:System.IAsyncDisposable> interface with the `@implements` directive.
233233

234234
The page title is set via the Blazor framework's <xref:Microsoft.AspNetCore.Components.Web.PageTitle> component, and an H1 section heading is the first rendered element:
235235

@@ -316,8 +316,9 @@ For the movie example from the last part of the tutorial series, *The Matrix*&co
316316

317317
The column names are taken from the `Movie` model properties, so the release date doesn't have a space between the words. Add a <xref:Microsoft.AspNetCore.Components.QuickGrid.ColumnBase%601.Title> to the <xref:Microsoft.AspNetCore.Components.QuickGrid.PropertyColumn%602> with a value that includes a space between the words:
318318

319-
```razor
320-
<PropertyColumn Property="movie => movie.ReleaseDate" Title="Release Date" />
319+
```diff
320+
- <PropertyColumn Property="movie => movie.ReleaseDate" />
321+
+ <PropertyColumn Property="movie => movie.ReleaseDate" Title="Release Date" />
321322
```
322323

323324
Run the app to see that the column displays two words for the release date.

aspnetcore/blazor/tutorials/movie-database-app/part-6.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ Append a query string to the URL in the address bar: `?titleFilter=road+warrior`
7171
Next, give users a way to provide the `titleFilter` filter string via the component's UI. Add the following HTML under the H1 heading (`<h1>Index</h1>`). The following HTML reloads the page with the contents of the textbox as a query string value:
7272

7373
```html
74-
<p>
74+
<div>
7575
<form action="/movies" data-enhance>
7676
<input type="search" name="titleFilter" />
7777
<input type="submit" value="Search" />
7878
</form>
79-
</p>
79+
</div>
8080
```
8181

8282
The `data-enhance` attribute applies *enhanced navigation* to the component, where Blazor intercepts the GET request and performs a fetch request instead. Blazor then patches the response content into the page, which avoids a full-page reload and preserves more of the page state. The page loads faster, usually without losing the user's scroll position.

0 commit comments

Comments
 (0)