示例#1
0
        /// <summary>
        /// Updates the breakfast review with the specified identifier.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="request">The request.</param>
        /// <returns></returns>
        public async Task <BreakfastReviewViewModel> UpdateRatingAsync(string id, UpdateBreakfastReviewRatingRequest request)
        {
            var result = await Repository.UpdateRatingAsync(id, request.Rating);

            if (result == null)
            {
                throw EntityNotFoundException.Create <BreakfastReview>(x => x.Id, id);
            }
            return(Mapper.Map <BreakfastReviewViewModel>(result));
        }
示例#2
0
 public async Task <BreakfastReviewViewModel> UpdateAsync(string id, [FromBody] UpdateBreakfastReviewRatingRequest request) =>
 await _service.UpdateRatingAsync(id, request);