stop trying to make fetch happen

it is not going to happen

Don't call ToList()

February 26, 2020 — ~level3

Lets say we are doing something with Entity Framework Core. Maybe pulling some data and "hydrating" some objects. Think twice before calling ToList() in the middle of the action. We are likely doing it wrong. Maybe we need to tweak the data model or maybe we need to adjust the query but we probably need to do something.

STOP.

Take a look at what we could do differently. Even if the query is fast, what if the number of results is 1000x?

tags: dot-net-core, entity-framework-core, programming, note-to-self