我希望这里的问题是它已经调用了GetChangeSet()
.
我建议你覆盖SubmitChanges()
数据上下文,并在那里应用这个逻辑......
partial class LawEnforcementDataContext { public override void SubmitChanges( System.Data.Linq.ConflictMode failureMode) { ChangeSet delta = GetChangeSet(); foreach (var reservation in delta.Deletes.OfType()) { // etc } base.SubmitChanges(failureMode); } }