Sources

DV DEV Community: #efcore
RSS

3stories
4 d agolatest
EF Core 10
Query patterns and SQL

EF Core Isn't Slow: Five Query Patterns That Are

This article outlines five EF Core query patterns behind many slow pages, plus one habit that catches them all: read the SQL EF generates instead of judging the C# code. It covers N+1 queries, loading whole tables or unneeded columns, cartesian explosions from collection Includes, and filters that prevent index use. It is a practical checklist for anyone writing data access code.

EF Core
Keep tenant data apart
DVDEV Community: #efcore Zohaib Ahmad 5 d ago

Multi-tenancy in EF Core: no tenant means no rows

The author shows a multi-tenancy pattern for ASP.NET Core and EF Core that uses global query filters so each request only sees its own tenant's rows. When no tenant is set, filtered queries return nothing, which fails closed. The post also covers tenant-scoped unique indexes, limiting IgnoreQueryFilters(), and an integration test that checks cross-tenant access. It is a practical starting point for SaaS backends.

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message