The response body is probably not a valid numeric string. Post its value.
How to fix Unhandled exception rendering component: The JSON value could not be converted to System.Int32.
tony kong
0
Reputation points
When I use the PlaceOrder method, it causes this error. The version is 8.0. Thank you.
async Task PlaceOrder()
{
isSubmitting = true;
var response = await HttpClient.PostAsJsonAsync(NavigationManager.BaseUri + "orders", OrderState.Order);
var newOrderId = await response.Content.ReadFromJsonAsync<int>();
OrderState.ResetOrder();
NavigationManager.NavigateTo("/");
}
Developer technologies | .NET | Blazor
1,675 questions
Developer technologies | .NET | Other
Developer technologies | .NET | Other
Microsoft Technologies based on the .NET software framework
4,107 questions
1 answer
Sort by: Most helpful
-
Bruce (SqlWork.com) 78,236 Reputation points Volunteer Moderator
2024-08-22T15:35:42.2666667+00:00