We have tried to Shadow the 4 Save Methods in one of our Entity Classes, so that we can implement a MarkForDeletion property. This would allow us to only delete the entity from the database if the save method has been called (for cancelling/reset purposes).
For some reason these Save methods never seem to be hit. Why is this not working.
We are using the latest version of LLBLGen, using a Self Servicing template.
To save our entities we are using ParentEntityName.Save(True), which should then trickle down to all the save methods of the children. It is the child entity that has the shadowed saves.
Public Shadows Function Save() As Boolean
If Me.ToBeDeleted Then
Me.Delete()
Else
MyBase.Save()
End If
End Function
Public Shadows Function Save(ByVal recurse As Boolean) As Boolean
If Me.ToBeDeleted Then
Me.Delete()
Else
MyBase.Save(recurse)
End If
End Function
Public Shadows Function Save(ByVal updateRestriction As SD.LLBLGen.Pro.ORMSupportClasses.IPredicate) As Boolean
If Me.ToBeDeleted Then
Me.Delete()
Else
MyBase.Save(updateRestriction)
End If
End Function
Public Shadows Function Save(ByVal updateRestriction As SD.LLBLGen.Pro.ORMSupportClasses.IPredicate, ByVal recurse As Boolean) As Boolean
If Me.ToBeDeleted Then
Me.Delete()
Else
MyBase.Save(updateRestriction, recurse)
End If
End Function