Ejemplo n.º 1
0
 public ActionResult <string> Get(int n)
 {
     _logger.LogInformation("Beginning a fibonnacci search!");
     try
     {
         //create new fib object and return the result
         var f   = new Fib();
         var res = f.FindFib(n);
         return(Ok(res.ToString()));
     }
     catch (OverflowException e) //catch any result overflow issues if it becomes too large
     {
         _logger.LogError(e.ToString());
     }
     //return generic error for security reasons
     return(BadRequest("Error has occurred"));
 }