Exemplo n.º 1
0
 public List<MovieViewModel> GetAll()
 {
     MovieViewModels = new List<MovieViewModel>();
     List<Movie> Movies = new MoviesStoreProxy.Repository.Facade().GetMovieRepository().ReadAll();
     List<Genre> Genres = new MoviesStoreProxy.Repository.Facade().GetGenryRepository().ReadAll();
     foreach (Movie mov in Movies)
     {
         MovieViewModel newViewModel = new MovieViewModel() { Movie = mov, Genre = Genres.FirstOrDefault(x => x.Id == mov.GenreId) };
         MovieViewModels.Add(newViewModel);
     }
     return MovieViewModels;
 }
 public OrderLineViewModel(MovieViewModel movie, int amount)
 {
     MovieVM = movie;
     Amount = amount;
 }