Skip to content

First MVC tutorial: Movie properties should be nullable except Genre using [Required] annotation #34580

Closed
@wadepickett

Description

@wadepickett

Description

In the last example for data annotations, the [Required] annotations are changed with only Genre using [Required]. The rest should have a nullable type indicator ? present.

Example:

public string Title { get; set; }

should be:

public string? Title { get; set; }

Page URL

https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/validation?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/tutorials/first-mvc-app/validation.md

Document ID

12fe9329-2cef-4056-4986-18ed7ae5c397

Article author

@wadepickett

Metadata

  • ID: 443a7c53-cc16-7ed5-5950-46a6f195f19c
  • Service: aspnet-core
  • Sub-service: tutorials

Related Issues


Associated WorkItem - 366976

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    First MVC tutorial: Movie properties should be nullable except Genre using [Required] annotation · Issue #34580 · dotnet/AspNetCore.Docs