Sep 19, 2019 08:37 AM|PatriceSc|LINK
Something like var query=db.Items.Where(o=>o.Name.StartsWith("A")); just defines a query but doesn't run it. The query will run the first time you iterate on data using foreach or ToList...
(if familiar with ADO.NET it could be compared with creating a SqlCommand and later executing this SqlCommand).
So yes ToList is often used when you want to explicitely load data at this point rather than having the query being triggered later at the UI level for example...