예제 #1
0
        public ActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Director director = _directorService.Find(id);

            if (director == null)
            {
                return(HttpNotFound());
            }

            DirectorViewModel directorViewModel = Mapper.Map <DirectorViewModel>(director);

            return(View(directorViewModel));
        }
예제 #2
0
        public ActionResult GetDirectorsOfMovie(Guid id)
        {
            var listDirectorIds = _directorMovieService.GetIdDirectorByMovieId(id);
            ICollection <Director> directors = new List <Director>();

            foreach (var directorId in listDirectorIds)
            {
                Director director = _directorService.Find(directorId);
                if (director != null)
                {
                    directors.Add(director);
                }
            }

            var directorViewModels = AutoMapper.Mapper.Map <IEnumerable <DirectorViewModel> >(directors);

            return(PartialView("_DirectorsOfMovie", directorViewModels));
        }