When optimizing LINQ queries, using the ___________ method can help in reducing the number of database round trips.

  • FirstOrDefault()
  • Include()
  • Skip()
  • ToList()
The correct answer is ToList(). When you use ToList() method, it retrieves all the data from the database at once and then performs operations on it in memory. This can reduce the number of database round trips by fetching all data needed in a single trip, potentially improving performance.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *