diff --git a/entity-framework/core/modeling/entity-types.md b/entity-framework/core/modeling/entity-types.md index a89541f7d5..e105062a61 100644 --- a/entity-framework/core/modeling/entity-types.md +++ b/entity-framework/core/modeling/entity-types.md @@ -2,7 +2,7 @@ title: Entity Types - EF Core description: How to configure and map entity types using Entity Framework Core author: AndriySvyryd -ms.date: 10/25/2021 +ms.date: 08/19/2026 uid: core/modeling/entity-types --- # Entity Types @@ -83,6 +83,14 @@ Rather than specifying the schema for each table, you can also define the defaul Note that setting the default schema will also affect other database objects, such as sequences. +## Table triggers + +You can use the Fluent API to specify that a database trigger exists for a table: + +[!code-csharp[HasTrigger](../../../samples/core/Miscellaneous/NewInEFCore7/SaveChangesPerformanceSample.cs?name=HasTrigger)] + +Calling `HasTrigger` only registers the trigger in the EF model. EF migrations don't create the trigger in the database; add the trigger DDL to a migration using [`migrationBuilder.Sql`](xref:core/managing-schemas/migrations/managing#arbitrary-changes-via-raw-sql). + ## View mapping Entity types can be mapped to database views using the Fluent API.