public async Task SaveReview() { if (Rating != 0 && Comment != null) { var review = new Review { Rating = Rating, Description = Comment, AccountId = _user.GetUserId(), VideoId = movieId }; var result = await _reviewsRepo.AddReview(review); if (result) { _events.PublishOnUIThread(new NewReviewAddedEvent()); this.TryClose(); } else { MessageBox.Show("Coś poszło nie tak.\nSpróbuj ponownie"); } } }
private async Task LoadRentals() { var rentals = await _rentalRepo.GetRentals(_user.GetUserId()); MovieRentals = new BindableCollection <MovieRentalModel>(); if (rentals != null && rentals.Count > 0) { foreach (var rental in rentals) { var rentalModel = _mapper.Map <MovieRentalModel>(rental); rentalModel.Movie = _mapper.Map <MovieModel>(rental.Video); MovieRentals.Add(rentalModel); } } }