Disable and enable table triggers in EF core in .NetCore

Viewed 2297

I would like to delete few rows from a table through EF core. Table has a trigger on it which does not allow deletes but adds a date to a deleted column.

Is there a way in EF core to disable trigger, then call Removeand then enable trigger back again on again after saving changes.

Repository Function

//Disable Trigger on Department Table

context.Department.Remove(dept);
context.SaveChanges();

//Enable Trigger

How do I manipulate triggers in EF core inside the code?

1 Answers
Related