I have in my class:
public class submitRequest
{
public int students { get; set; } = 0;
When I send from frontend to backend a non-number (e.g. null, or empty string), it does not use default value and I get:
"The JSON value could not be converted to System.Int32. Path: $.students"
But when I only have
public int students { get; } = 0;
it works fine. But then I have problems that correct values (1, 2, ...) sent from frontend are ignored, and the value of students is always 0.