2021-02-16 06:06:48 +08:00
---
2021-05-09 04:12:34 +08:00
no-loc: [Home, Privacy, Kestrel, appsettings.json, "ASP.NET Core Identity", cookie, Cookie, Blazor, "Blazor Server", "Blazor WebAssembly", "Identity", "Let's Encrypt", Razor, SignalR]
2021-02-16 06:06:48 +08:00
---
2018-12-14 06:58:09 +08:00
<!-- THIS INCLUDE USED BY MVC AND RP -->
2018-12-03 10:09:41 +08:00
Add the following properties to the `Movie` class:
[!code-csharp[ ](~/tutorials/razor-pages/razor-pages-start/sample/RazorPagesMovie22/Models/Movie.cs?name=snippet1 )]
The `Movie` class contains:
* The `ID` field is required by the database for the primary key.
2020-04-20 04:44:51 +08:00
* `[DataType(DataType.Date)]` : The [DataType ](xref:System.ComponentModel.DataAnnotations.DataTypeAttribute ) attribute specifies the type of the data (Date). With this attribute:
2018-12-03 10:09:41 +08:00
* The user is not required to enter time information in the date field.
* Only the date is displayed, not time information.
2019-11-06 06:24:20 +08:00
[DataAnnotations ](/dotnet/api/system.componentmodel.dataannotations ) are covered in a later tutorial.