liveBook · Manning

Global query filter

As explained in ASP.NET Core in Action, 3e

A global query filter is an Entity Framework Core model-level predicate that is automatically applied to queries for an entity type.

A global query filter is an Entity Framework Core model-level predicate that automatically adds a Where condition when querying an entity type. For example, a Recipe filter can hide records whose IsDeleted flag is true without repeating the condition in every service method. section 12.4.4

Use global query filters to:

How ASP.NET Core in Action, 3e covers it

How deep it goes
Defines the feature and its uses but stops short of showing configuration code or explaining filter internals.
Examples
Uses an IsDeleted flag on Recipe entities and tenant-based data segregation as examples.
What it assumes
Assumes familiarity with Entity Framework Core, entity properties, and Where clauses.
What you can do after
Apply a model-level Where condition for soft deletion or tenant data segregation.
How it connects
Connects Entity Framework Core with soft delete and multitenancy.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.