The target is to get list of 10 popular movies.
There is a table called populars
in the database that contains:
moviecount
- the number of times the film was rented.
MovieID
- id of the film.
There's also a table called Movies that contains all the data of the movies. This table contains a field for MovieID. The tables are not related and should not be linked between them.
I took the 10 id's of the most popular films
var TopTen = videoLibDB.populars
.Take(10)
.OrderBy(e => e.movieCount)
.Select(e => new { e.MovieID });
This is ok, but how do I create a List of the 10 best movies from "movies" table by using 10 MovieIDs of the populars table(the TopTen of the code above)?
In case of one id I can compare the moiveid from the popular table to the movieid in the movies table.