Exemplo n.º 1
0
 public IActionResult UpdateReview(UpdateReviewDTO reviewDTO)
 {
     if (_reviewService.Update(reviewDTO))
     {
         return(Ok());
     }
     return(NotFound(new { message = "Review not found" }));
 }
Exemplo n.º 2
0
        public bool Update(UpdateReviewDTO reviewDTO)
        {
            bool isUpdated = true;
            var  review    = _reviewRepository.FindById(reviewDTO.Id);

            if (review == null)
            {
                isUpdated = false;
                return(isUpdated);
            }
            review.Content = reviewDTO.Content;
            _reviewRepository.Update(review);
            return(isUpdated);
        }