Beispiel #1
0
        public async Task <ActionResult> RemoveRatingAsync(int id)
        {
            try
            {
                var userId = HttpContext.GetCurrentUserId();
                await _ratingsService.RemoveRatingAsync(userId, id);

                await _FilmsService.UpdateRatingAsync(id);

                return(Ok(Mapper.Map <RatingDTO, RatingResponse>(_ratingsService.GetRating(id, userId))));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }