Global Query Filters

In this lesson, we’ll learn about global query filters.

Overview

In this lesson, we review global query filters.

Note: The outputs from the projects in this lesson contain the result of the sample codes and logs for the translated SQL queries used.

Global query filters

Global query filters enable us to apply query predicates to entities in the OnModelCreating method. EF Core then applies the predicate automatically to any LINQ queries involving those entities directly or indirectly through navigation properties. We’ll demonstrate them using the C# console project below:

Get hands-on with 1400+ tech skills courses.