I'm working on my first Razor/Blazor application. This is a .NET 8 application. I'm using Entity Framework 8 for this app. Here's a snippet from the .razor page:
<table class="table"><thead><tr><th>Video Number</th><th>Episode Name</th></tr></thead><tbody> @foreach (var entry in entries) {<tr><td>@entry.VideoNumber</td><td>@entry.EpisodeName</td></tr> }</tbody></table>And lower in the same page is the C# code to retrieve the data from the database:
var contentStream = await httpResponse.Content.ReadAsStreamAsync();return await System.Text.Json.JsonSerializer.DeserializeAsync<Entry[]>(contentStream, new System.Text.Json.JsonSerializerOptions { DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, PropertyNameCaseInsensitive = true });The EpisodeName data is returned exactly as it is saved in the database. But the VideoNumber data is all returned as zero (0), which is wrong.
What am I doing wrong?