Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var sessions = from s in db.Sessions where s.TheaterID == id orderby s.MovieID, s.Time select s;
- public ActionResult MyAction(int id)
- {
- Theather theater = db.Theater.Find(id);
- ViewBag.TheaterName = theater.NomeCinema;
- var sessions = from s in db.Sessions where s.TheaterID == id orderby s.MovieID, s.Time select s;
- var mapMovies = new Dictionary<string, List<DateTime>>();
- foreach (Session s in sessions)
- {
- if ( !mapMovies.ContainsKey( s.Movie.MovieName ) )
- {
- mapMovies.Add( s.Movie.MovieName, new List<DateTime>() );
- }
- mapMovies[s.Movie.MovieName].Add(s.Time);
- }
- ViewBag.MapMovies = mapMovies;
- return View();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement