public IActionResult Post([FromBody] Rating rating) { //This is the beginning of the conditional logic block if (rating == null) { return(BadRequest()); } else if (rating.Id == 0) { _ratingService.AddRating(rating); return(Ok()); } else { _ratingService.UpdateRating(rating); return(Ok()); } //This is the end of the conditional logic block }