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
Does this mean that either you cant use entity framework for deletes (and instead need to write custom procedures that delete related entities) or you cant use temporal tables? (I suppose you could also write entity framework code to delete the related items from the bottom up as well but I don't want dozens of little calls from my API app back to my database)
The text was updated successfully, but these errors were encountered:
@slubowsky I believe temporal tables should be usable with EF, with a couple of limitations as described here: #4693.
With regard to cascade deletes, EF does not require cascade deletes on the database in order to function correctly. However, if the database does not have cascade deletes, then all related entities must be loaded into the context before the delete happens to ensure that everything is deleted that should be.
@ajcvickers Thanks. I didn't know that. I thought delete cascade was the only way to get this kind of behavior in EF. Only other place I see this is in another post by you #5871. Perhaps this should be somewhere in the documentation, or maybe it already is and I'm just not finding it.
Ill have to play with this. If I can get it to do minimal loading using projections maybe Ill give it a shot so all my code is in one place, otherwise I guess Ill stick with stored procedures for efficiency.
Temporal tables have several restrictions https://msdn.microsoft.com/en-us/library/mt604468.aspx including no cascading deletes or "instead of" triggers.
Does this mean that either you cant use entity framework for deletes (and instead need to write custom procedures that delete related entities) or you cant use temporal tables? (I suppose you could also write entity framework code to delete the related items from the bottom up as well but I don't want dozens of little calls from my API app back to my database)
The text was updated successfully, but these errors were encountered: