Compile-time safety · EF Core
LinqContraband
A Roslyn analyser that reads your LINQ the way the database will. N+1 queries and client-side evaluation get caught in the editor, not after a slow page has annoyed everyone.
Materialising before filtering pulls the whole table into memory.
db.Orders
.ToList()
.Where(o => o.Total > 1_000)
db.Orders
.Where(o => o.Total > 1_000)
.ToList()
The database filters; the editor catches the expensive shape before review.