private async void GetDirectShowInfo(int id)
        {
            try
            {
                BusyIndicatorValue = true;
                var show = await _dataService.GetDirectShowData(id);

                List <MediaCrew> crews = (show.Credits.Crew).Take(10).ToList();
                List <MediaCast> casts = (show.Credits.Cast).Take(10).ToList();
                DirectShow = show;
                Crew       = new ObservableCollection <MediaCrew>(crews);
                Cast       = new ObservableCollection <MediaCast>(casts);

                ShowDTO showFromDb = _showService.GetShow(DirectShow.Id);
                if (showFromDb == null)
                {
                    CanDelFromDb = false;
                    CanAddToDb   = true;
                }
                else
                {
                    CanDelFromDb = true;
                    CanAddToDb   = false;
                }
                BusyIndicatorValue = false;
            }
            catch (ServiceRequestException)
            {
                RaiseNotification();
            }
            catch (Exception e)
            {
                _logger.ErrorException(ForExceptions, e);
            }
        }
Example #2
0
        public IActionResult GetMovie(string id)
        {
            var movie = _showService.GetShow(id);

            if (movie != null)
            {
                return(Ok(movie));
            }
            return(NotFound(id));
        }
Example #3
0
        public void GetShows_ValidId_ReturnsShow()
        {
            //Arrange
            _showService.GetShow(Arg.Any <int>()).Returns(_jsonSerializeService.SerializeObject(_mockShowDto));

            //Act
            var show = _apiClientMock.GetShow(1);

            show.Wait();

            //Assert
            Assert.AreEqual(_jsonSerializeService.SerializeObject(_mockShowDto), _jsonSerializeService.SerializeObject(show.Result));
        }
Example #4
0
        public async Task <ShowDto> GetShow(int id)
        {
            var json = await _showService.GetShow(id);

            var show = _jsonSerializeService.TryDeserializeObject <ShowDto>(json);

            if (show.success)
            {
                return(show.obj);
            }

            throw new InvalidShowException($"Show id: {id}");
        }
Example #5
0
 public Show GetShow(int id)
 {
     return(Show.GetShow(id));
 }