Ejemplo n.º 1
0
        public IActionResult PostRating(RatingViewModel rating)
        {
            bool IsRatingAdded;

            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid data."));
            }
            else
            {
                IsRatingAdded = ratingRequest.AddRating(rating);
            }
            if (IsRatingAdded)
            {
                return(Ok());
            }
            else
            {
                return(BadRequest("Unable to add Rating"));
            }
        }