EntityFrameworkCore.DbUpdateException: Could not save changes because the target table has database triggers. Please configure your entity type accordingly
After migration from .NET Core 3.1 to the newest .NET 7 and Entity Framework 7 I received on the production environment the following error message for a few entities during data updates: EntityFrameworkCore.DbUpdateException: Could not save changes because the target table has database triggers. Please configure your entity type accordingly On my development environment everything works as expected without any error. But the production database has some Triggers attached to some SQL Tables ... so the error occurred only in production - very frustrating :-( Thats why: Development and Production environment should be identical. The reason for the error is described in the MSDN documentation By default, EF Core now saves changes via a significantly more efficient technique; unfortunately, this technique is not supported on SQL Server if the target table has database triggers, or certain types of computed columns The problem can be solved very easy. Just open the database context cl...