Advertisement
TankorSmash

Untitled

Jan 12th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 KB | None | 0 0
  1.         public ActionResult sql()
  2.         {
  3.  
  4.             MovieDbContext db = new MovieDbContext();
  5.  
  6.             Tools.TraceLine("start build query to list");
  7.             var res = (from movie in db.Movies
  8.                        from boxart in db.BoxArts
  9.                        where boxart.movie_ID == movie.movie_ID
  10.                        from omdb in db.Omdb
  11.                        where omdb.movie_ID == movie.movie_ID
  12.                        select new
  13.                                   {
  14.                                       Boxarts = boxart,
  15.                                       Movie = movie,
  16.                                       OmdbEntry = omdb,
  17.                                       Genres = (from genre in db.Genres
  18.                                                 join gid in
  19.                                                     (from mtg in db.MovieToGenres
  20.                                                      where
  21.                                                          mtg.movie_ID ==
  22.                                                          movie.movie_ID
  23.                                                      select mtg.genre_ID) on
  24.                                                     genre.genre_ID equals gid
  25.                                                 select genre.genre_string)
  26.                                   }).ToList();
  27.  
  28.  
  29.  
  30.  
  31.  
  32.             return View();
  33.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement