Skip to content

Commit a71beec

Browse files
committed
update screenshots to match the description
1 parent 57c0b4e commit a71beec

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

aspnetcore/tutorials/first-mvc-app/controller-methods-views.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: wadepickett
44
description: Part 6, add a model to an ASP.NET Core MVC app
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: wpickett
7-
ms.date: 03/02/2025
7+
ms.date: 24/11/2025
88
uid: tutorials/first-mvc-app/controller-methods-views
99
---
1010

@@ -18,14 +18,18 @@ By [Rick Anderson](https://twitter.com/RickAndMSFT)
1818

1919
We have a good start to the movie app, but the presentation isn't ideal, for example, **ReleaseDate** should be two words.
2020

21-
![Index view: Release Date is one word (no space) and every movie release date shows a time of 12 AM](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90.png)
21+
![Index view: Release Date is one word (no space) and every movie release date shows a time of 12 AM](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90_not_formatted.png)
2222

2323
Open the `Models/Movie.cs` file and add the highlighted lines shown below:
2424

2525
[!code-csharp[](~/tutorials/first-mvc-app/start-mvc/sample/mvcmovie90/Models/Movie.cs?name=snippet_Second&highlight=2,3,12,13,16)]
2626

2727
`DataAnnotations` are explained in the next tutorial. The [Display](xref:System.ComponentModel.DataAnnotations.DisplayAttribute) attribute specifies what to display for the name of a field (in this case "Release Date" instead of "ReleaseDate"). The [DataType](xref:System.ComponentModel.DataAnnotations.DataTypeAttribute) attribute specifies the type of the data (Date), so the time information stored in the field isn't displayed.
2828

29+
Using the data annotations above, run the application and refresh the `/Movies` page. Because the view markup uses the `@Html.DisplayNameFor` and `@Html.DisplayFor` methods to render the property name and value, the updated `Index` view shows all the fields properly formatted. For example, **Release Date** is now two words and the time information is no longer shown.
30+
31+
![Index view: Release Date is two words and every movie release date is shown without the time](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90_formatted.png)
32+
2933
The `[Column(TypeName = "decimal(18, 2)")]` data annotation is required so Entity Framework Core can correctly map `Price` to currency in the database. For more information, see [Data Types](/ef/core/modeling/relational/data-types).
3034

3135
Browse to the `Movies` controller and hold the mouse pointer over an **Edit** link to see the target URL.

aspnetcore/tutorials/first-mvc-app/working-with-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Test the app. Stop it and restart it so the `SeedData.Initialize` method runs an
120120

121121
The app shows the seeded data.
122122

123-
![MVC Movie app open in Microsoft Edge showing movie data](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90.png)
123+
![MVC Movie app open in Microsoft Edge showing movie data](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90_not_formatted.png)
124124

125125
> [!div class="step-by-step"]
126126
> [Previous: Adding a model](~/tutorials/first-mvc-app/adding-model.md)
-45.6 KB
Loading
78.7 KB
Loading
79.5 KB
Loading

0 commit comments

Comments
 (0)