Search code examples
c#sql-servertriggersentity-framework-4

Is there a way to define a SQL trigger-like mechanism in EF4?


I need to create an audit log like feature where most of one table's fields are copied to another when they are modified. Normally, I would create a SQL trigger to do this.

Is there an Entity Framework 4 equivalent, where upon modifying Entity X I could modify Entity Y?


Solution

  • There are some approaches out there on using ObjectContext.SaveChanges and the ObjectStateManager to perform such auditing requirements in EF

    Link

    Link