Exercise: Find Your Favorite Movies
Write your first LINQ query
Now, it’s your turn!
- Add your movies to the code sample and find which ones are your favorite movies.
- Next, find all the films released in the year you were born. Fill in the body of the
WasReleasedOnmethod. It should check if a movie’s release year matches the given year.
- Then, inside the
FindMoviesReleasedOnmethod, write a LINQ query to filter the
moviescollection using the
WasReleasedOnmethod from step 2.
There are some instructions as comments in the code sample below. Take your time to go through them. We are working with your answers in the following exercises and lessons.