Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Arguably the simplest query you can write is one that fetches all
the data for a given entity type. This is the equivalent of a SELECT * FROM mytable query in SQL. Fortunately
you don’t need to know SQL, because Entity Framework will take care of
translating LINQ queries into SQL for you.
Getting all the data from a set doesn’t require you to really write
a query. You can simply iterate over the contents of any given DbSet and Entity Framework will send a query to
the database to find all the data in that set. Let’s add a PrintAllDestinations method to our console
application that iterates over the Destinations set defined in our BreakAwayContext and prints out the name of each
Destination (Example 2-4).