Open mazanuj opened 2 years ago
Your code doesn't include the last phone number from the list Link
[HttpGet] public IActionResult Get() { var randomNumber = random.Next(0, Phones.Numbers.Length - 1); return Ok(Phones.Numbers[randomNumber].ToString()); }
change random.Next(0, Phones.Numbers.Length - 1) to random.Next(0, Phones.Numbers.Length)
random.Next(0, Phones.Numbers.Length - 1)
random.Next(0, Phones.Numbers.Length)
I would check how the count is used in the loop, this is written to start count at 0 and might not be the cause of the problem
Your code doesn't include the last phone number from the list Link
change
random.Next(0, Phones.Numbers.Length - 1)
torandom.Next(0, Phones.Numbers.Length)