public FilmReviewViewModel CreateFilmReview(FilmReviewModel newReview)
        {
            FilmReviewViewModel review = new FilmReviewViewModel
            {
                FilmReview = filmRepository.AddFilmReview(newReview),
                User = userRepository.GetUserList().FirstOrDefault(u => u.User_ID == newReview.User_ID)
            };

            return review;
        }
Ejemplo n.º 2
0
        public FilmReviewModel AddFilmReview(FilmReviewModel review)
        {
            int id = DataProvider.ExecuteScalar<int>("sp_FMAddFilmReviewToFilm",
                 new SqlParameter("@film_id", review.FIlm_ID),
                 new SqlParameter("@user_id", review.User_ID),
                 new SqlParameter("@title", review.Title),
                 new SqlParameter("@review", review.Review),
                 new SqlParameter("@rating", review.Rating));

            review.ID = id;

            return review;
        }