public async Task <IHttpActionResult> PutReviewAndRating(int id, [FromBody] ReviewAndRatingDTO reviewAndRatingDTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (await reviewServices.FindReviewAndRatingAsync(id) == null)
            {
                return(BadRequest());
            }

            var review = await reviewServices.GetReviewAndRatingAsync(id);

            ReviewAndRating reviewAndRating = new ReviewAndRating
            {
                CreatedDate = review.CreatedDate,
                HelperId    = review.HelperId,
                ReviewId    = review.ReviewId,
                UserId      = review.UserId
            };

            if (reviewAndRatingDTO.Ratings != null)
            {
                reviewAndRating.Rating = (int)reviewAndRatingDTO.Ratings;
            }
            else
            {
                reviewAndRating.Rating = review.Rating;
            }
            if (reviewAndRatingDTO != null)
            {
                reviewAndRating.Review = reviewAndRatingDTO.Reviews;
            }
            else
            {
                reviewAndRating.Review = review.Review;
            }

            try
            {
                await reviewServices.UpdateReviewAndRatingAsync(reviewAndRating);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ReviewAndRatingExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> PostReviewAndRating([FromBody] ReviewAndRatingDTO reviewAndRatingDTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            ReviewAndRating reviewAndRating = new ReviewAndRating
            {
                HelperId = reviewAndRatingDTO.HelperId,
                UserId   = reviewAndRatingDTO.UserId,
                Rating   = (int)reviewAndRatingDTO.Ratings,
                Review   = reviewAndRatingDTO.Reviews
            };

            await reviewServices.AddReviewAndRatingAsync(reviewAndRating);

            return(Ok(reviewAndRating.ReviewId));
        }