Watch for a table new records in sql database

前端 未结 6 1330
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 11:36

I am using EF in a windows application and I want my application to do some tasks when a new record inserted in a certain table \"these new records will be inserted by a we

6条回答
  •  囚心锁ツ
    2020-12-01 11:56

    Another suggestion is to use hooks where you override the SaveChanges and do your custom logic.

    https://stackoverflow.com/a/7654423/989679, https://github.com/kmckelvin/EFHooks/blob/master/EFHooks/HookedDbContext.cs http://thedatafarm.com/blog/data-access/objectcontext-savechanges-is-now-virtual-overridable-in-ef4/ (archive)

提交回复
热议问题