public async Task <IActionResult> Detail(long ID, int page)
        {
            var token   = HttpContext.User.FindFirst(ClaimTypes.Hash)?.Value;
            var ratings = await rateFacade.GetRatingsListAsync(token, new List <long> {
                ID
            }, null, null, null, 5, page);

            var genres = await genreFacade.GetGenresListAsync(null);

            var persons = await personFacade.GetPersonsFilterDataAsync();

            bool?saveSuccess = null;

            if (TempData.ContainsKey("SaveSuccess"))
            {
                saveSuccess = (bool)TempData["SaveSuccess"];
                TempData.Remove("SaveSuccess");
            }

            var MovieDetailViewModel = new MovieDetailViewModel()
            {
                DetailMovieModel = await movieFacade.GetMovieDetailAsync(ID),
                ListRatingModel  = ratings,
                Genres           = genres.ToList(),
                Persons          = persons,
                SaveSuccess      = saveSuccess
            };

            return(View(MovieDetailViewModel));
        }
Exemple #2
0
        public async Task <PaginatedDataOfRating> GetRatingList(IEnumerable <long> ID, String text, int?scoreFrom, int?scoreTo, int?limit, int?page)
        {
            var a = await _rateFacade.GetRatingsListAsync(HttpContext.User.FindFirst(ClaimTypes.Hash).Value, ID, text, scoreFrom, scoreTo, limit, page);

            return(a);
        }