public IActionResult ArrayHandler([FromBody] ComplexData complexData) { dynamic result = 0; if (complexData != null) { if (complexData.Numbers == null || complexData.Numbers.Length == 0) { return(Json(new { error = "Please provide an array of numbers!" })); } else if (complexData.What == null) { return(Json(new { error = "Please provide what to do with the numbers!" })); } else { return(Json(new { result = HomeRepository.ArithmeticTypeCheck(complexData) })); } } else { return(Json(new { error = "Please provide proper inputs!" })); } }