public IActionResult GetReversed([FromQuery] string [] productIds) { try { var result = _arrayManipulationService.ReverseArray(productIds); return(Ok(result)); } catch (Exception e) { return(BadRequest("Error while reversing array: " + e.Message)); } }
public IActionResult Reverse([FromQuery] string[] productIds) { try { if (productIds == null || productIds.Length == 0) { return(BadRequest("No product ids are passed")); } var result = _arrayManipulationService.ReverseArray(productIds); return(Ok(result)); } catch (Exception e) { return(BadRequest("Error while reversing array: " + e.Message)); } }