You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is by design, but when Deleted trigger is fired, if entry.Entity has any foreign key fields, those fields are null.
This makes this handler very limited in it's usability. The only workaround I found is using Deleting trigger. Which is for obvious reasons is not ideal. I'm I missing something?
The text was updated successfully, but these errors were encountered:
It depends on the relationship defined on those foreign keys. The entity you access through the Deleted event parameters is the same as if you had the entity reference itself after it was deleted.
If you can post a minimal example of the behaviour you're seeing and what you expect to see, that would be a good starting point to finding a solution.
Thanks for your quick reply. Some background: I use triggers to intercept DB events and create JSON messages that being sent to another system for synchronization.
It's possible, that issue is related to On Cascade Delete setting on DB side. The entity is a child entity and when Deleted is fired, the parent entity is already gone. It's a bit hard for me to extract that code. In any case, Deleting trigger does the trick. The only side effect: if deletion actually fails. It's highly unlikely but possible.
I'm not sure if this is by design, but when Deleted trigger is fired, if entry.Entity has any foreign key fields, those fields are null.
This makes this handler very limited in it's usability. The only workaround I found is using Deleting trigger. Which is for obvious reasons is not ideal. I'm I missing something?
The text was updated successfully, but these errors were encountered: