Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Why does the numeric value only return 0 in my Blazor app?

$
0
0

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?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>