Exemple #1
0
        public MovieCategoryVM Update(int Id)
        {
            var movie      = movieRepository.Get(x => x.Id == Id);
            var members    = new List <AppUser>();
            var nonmembers = new List <AppUser>();
            var appuser    = _appUserService.GetList();

            foreach (var item in appuser)
            {
                var list = _movieUserRepository.Any(x => x.AppUserId == item.Id && x.MovieId == movie.Id) ? members : nonmembers;
                list.Add(item);
            }
            var model = new MovieCategoryVM();

            model.Categories      = _categoryService.GetList();
            model.Movie           = _map.Map <MovieDTO>(movie);
            model.Movie.Member    = members;
            model.Movie.NonMember = nonmembers;
            return(model);
        }
 public IActionResult Add(MovieCategoryVM model)
 {
     model.Categories = _categoryService.GetList();
     return(View(model));
 }