AspNetCore.Docs/aspnetcore/includes/mvc-intro/model1b.md

886 B

no-loc
Home
Privacy
Kestrel
appsettings.json
ASP.NET Core Identity
cookie
Cookie
Blazor
Blazor Server
Blazor WebAssembly
Identity
Let's Encrypt
Razor
SignalR

Add the following properties to the Movie class:

[!code-csharp]

The Movie class contains:

  • The Id field which is required by the database for the primary key.

  • [DataType(DataType.Date)]: The DataType attribute specifies the type of the data (Date). With this attribute:

    • The user is not required to enter time information in the date field.
    • Only the date is displayed, not time information.

DataAnnotations are covered in a later tutorial.