I would like to add code in the Save event to manually assign a sequence value to the primary key if it has not already been set. (I must do it this way rather than doing it properly via configuration in the designer).
The cleanest way would seem to be a partial class that would override the appropriate Save method(s), ie:
Partial Public Class EVENTEntity
Public Overrides Function Save() As Boolean()
If EVENT_ID = 0 Then
ActionProcedures.SEQ_EVENT_ID_NEXTVAL(EVENT_ID)
End If
MyBase.Save()
End Function
End Class
However, I get the error:
'Public Overrides Function Save() As Boolean()' cannot override 'Public Function Save() As Boolean' because it is not declared 'Overridable'.
Is there a way around this, or is there a better way of doing it?