[英]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.
通常,我将创建一个SQL触发器来执行此操作。
Is there an Entity Framework 4 equivalent, where upon modifying Entity XI could modify Entity Y? 是否有等效的Entity Framework 4,在修改XI时可以在哪里修改Y实体?
There are some approaches out there on using ObjectContext.SaveChanges and the ObjectStateManager to perform such auditing requirements in EF 有一些方法可以使用ObjectContext.SaveChanges和ObjectStateManager在EF中执行此类审核要求
http://blogs.msdn.com/b/simonince/archive/2009/04/17/auditing-data-changes-in-the-entity-framework-part-1.aspx http://blogs.msdn.com/b/simonince/archive/2009/04/17/auditing-data-changes-in-the-entity-framework-part-1.aspx
http://blogs.msdn.com/b/simonince/archive/2009/04/17/auditing-data-changes-in-the-entity-framework-part-2.aspx http://blogs.msdn.com/b/simonince/archive/2009/04/17/auditing-data-changes-in-the-entity-framework-part-2.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.