Beispiel #1
0
        public async Task UpdateRatingAsync(int filmId)
        {
            var film = _unitOfWork.Films.Get(filmId);

            if (film == null)
            {
                throw new FilmNotExistsException("Film not exists!")
                      {
                          FilmId = filmId
                      }
            }
            ;
            film.Rating = _ratingsService.GetFilmsAverageRating(filmId);

            _unitOfWork.Films.Update(film);
            await _unitOfWork.SaveAsync();
        }