示例#1
0
 // GET: Films
 public ActionResult Index([ModelBinder(typeof(UserModelBinder))] User user)
 {
     return(View(FilmsDao.FindAllWithGenres()
                 .Select(f => new FilmView(f)
     {
         IsFav = user.HasFavourite(f.ID)
     })
                 .OrderBy(f => f.Title)));
 }
示例#2
0
        // GET: Home
        public ActionResult Index([ModelBinder(typeof(UserModelBinder))] User user)
        {
            var info = new FilmsSearchInfoBase()
            {
                Genres = GenresDao.FindAll()
                         .OrderBy(g => g.Name),
                Actors = ActorsDao.FindAll()
                         .Select(a => new ActorView(a))
                         .OrderBy(a => a.FullName)
                         .ToList(),
                FilmsDefaultView = FilmsDao.FindAllWithGenres()
                                   .Select(f => new FilmView(f)
                {
                    IsFav = user.HasFavourite(f.ID)
                })
                                   .OrderByDescending(f => f.ReleaseDate)
            };

            return(View(info));
        }