There's a balance to strike here, and it depends on context.
The first one streams the results from the database, so doesn't load it all into memory at once, this is good if you only need to iterate once, and clients know that they are dealing with something that is coming from the database. It saves on memory, and initial execution time.
With the ToList() it will do the full query, and load every item into memory prior to doing the foreach. This is good in the way that you have your data access over all in one go, which could be beneficial if you will be referring to the enumerable multiple times within the method or don't want to keep the connection open for long.
If memory is an issue, go for the first one, otherwise, its probably simpler to use ToList() when dealing with entity framework outside of a repository.