AspNetCore.Docs
AspNetCore.Docs copied to clipboard
Missing Required attribute on last code snippet
[RegularExpression(@"^[A-Z]+[a-zA-Z0-9""'\s-]*$"), StringLength(5)]
public string Rating { get; set; } should be
[RegularExpression(@"^[A-Z]+[a-zA-Z0-9""'\s-]*$"), StringLength(5), Required]
public string Rating { get; set; }
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 443a7c53-cc16-7ed5-5950-46a6f195f19c
- Version Independent ID: 12fe9329-2cef-4056-4986-18ed7ae5c397
- Content: Adding Validation
- Content Source: aspnetcore/tutorials/first-mvc-app/validation.md
- Product: asp.net-core
- GitHub Login: @Rick-Anderson
- Microsoft Alias: riande
The Title property in that snippet is missing the Required attribute as well.