AspNetCore.Docs
AspNetCore.Docs copied to clipboard
adding the [Required] annotations
got this error on index at line 50: Movie = await movies.ToListAsync(); : Microsoft.EntityFrameworkCore.Query: Error: An exception occurred while iterating over the results of a query for context type 'RazorPagesMovie.Data.RazorPagesMovieContext'. System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
removing the [Required] made the error go away
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 39b6d0f3-9bc7-d091-0d45-9fc1e2e7aac8
- Version Independent ID: 20e7eb53-215b-09ab-205d-d20177221278
- Content: Add validation to an ASP.NET Core Razor Page
- Content Source: aspnetcore/tutorials/razor-pages/validation.md
- Product: aspnet-core
- Technology: aspnetcore-tutorials
- GitHub Login: @Rick-Anderson
- Microsoft Alias: riande
The tutorial works. I'm not sure what step you missed. You might try asking on StackOverflow,.