public async Task <IActionResult> Save(MovieRatingDto movieRatingDto) { movieRatingDto.UserId = ActiveUser.Get().UserId; var newMovieRating = await _movieRatingService.Insert(_mapper.Map <MovieRating>(movieRatingDto)); return(Created(string.Empty, _mapper.Map <MovieRatingDto>(newMovieRating))); }
public async Task <List <MovieRating> > GetByMovieId(int movieId) { var user = ActiveUser.Get(); var query = await GetAllAsync(); return(await query.Where(x => x.MovieId == movieId && x.UserId == user.UserId).ToListAsync()); }