Esempio n. 1
0
        public ViewModelPerfil()
        {
            this.repo = new RepositoryCinema();

            this.repoMovie = new RepositoryMovie();
            this.repo      = new RepositoryCinema();

            //App.Locator.SessionService.Datos.
            SessionService session = App.Locator.SessionService;

            Task.Run(async() =>
            {
                this.Usuario            = await this.repo.GetUser(session.Email, session.token);
                List <Lists> listMovies = await repo.GetUserList(session.Email, session.token);
                List <Movie> movies     = new List <Movie>();
                if (listMovies != null)
                {
                    foreach (Lists lItem in listMovies)
                    {
                        movies.Add(await repoMovie.GetMovie(lItem.IdMovie));
                    }
                }
                this.Movies = new ObservableCollection <Movie>(movies);
            });
        }
Esempio n. 2
0
        private async Task LoadList()
        {
            List <Lists> listMovies = await repoCine.GetUserList(session.Email, session.token);

            List <Movie> movies = new List <Movie>();

            if (listMovies != null)
            {
                foreach (Lists lItem in listMovies)
                {
                    movies.Add(await repoMovie.GetMovie(lItem.IdMovie));
                }
            }
            this.Movies = new ObservableCollection <Movie>(movies);
        }