public IHttpActionResult GetAnswer() { Thread.Sleep(3000); var possibilities = new string[] { "42", "popcorn", "vacations", "money", "friends", "movies" }; var rnd = new Random(); var index = rnd.Next(possibilities.Length); var answer = new Answer { Text = "The answer is " + possibilities[index] }; return Ok(answer); }
public IHttpActionResult GetFortune() { Thread.Sleep(3000); var possibilities = new string[] { "You are destined to be eaten by a bear.", "You will be rich and powerful beyond your dreams.", "You will win a talent show and start a succesful rock band." }; var rnd = new Random(); var index = rnd.Next(possibilities.Length); var answer = new Answer { Text = possibilities[index] }; return Ok(answer); }