Esempio n. 1
0
 public ActionResult AddPrediction([FromBody] Prediction prediction)
 {
     //TryValidateModel(prediction);
     if (prediction == null)
     {
         return(StatusCode(StatusCodes.Status400BadRequest));
     }
     try
     {
         _predictionsManager.AddPrediction(prediction.PredictionString);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         return(StatusCode(StatusCodes.Status500InternalServerError));
     }
     return(Ok());
 }
        public ActionResult AddPrediction([FromBody] Prediction prediction)
        {
            if (prediction == null)
            {
                return(StatusCode(StatusCodes.Status400BadRequest));
            }

            try
            {
                _predictionsManager.AddPrediction(prediction.PredictionString);
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }

            return(Ok());
        }