I have a form that has key value array like this:
In this array, keys has not started from zero so when I defined Request model for get this array as you can see I can't get any value from this array.
Notice that when I try to send this array from zero key that's work correctly:
But I need to send this array with that approach because the keys make sense.
Request Model Class:
public class Correction
{
[Required]
public int theory_exam_id { get; set; }
[Required]
public int[] answers { get; set; }
}
Controller Method:
[HttpPost("correction")]
public async Task<ActionResult<TheoryExam>> CorrectionTheoryExam([FromForm] Correction correction)
{
return Ok(correction);
}


