i have a project which runs with strict mode off and this code.
Public Overloads Function Save() As Child
Return MyBase.Save()
End Function
Upon turning strict mode on, an error displays:
Option Strict On disallows implicit conversions from 'Parent' to 'Child'.
My question is the parent's save that is being executed OR the child's as the parent's object is being cast to the child's type?
Long Version with all the details:
I am trying to understand what this code exactly does to reproduce it clearly in the VB, so it can be clearly ported to C#.
The project is using CSLA, there is a base object, which is inherited from the Parent of the child. Child inherits Parents which inherits Base.
There is Insert at both the child & the parent. Are both of those called, by that weird difference of the return object and the function's type?
If you are trying to have
ParentsubclassCsla.BusinessBase, and then haveChildsubclassParent, you need to implementParentlike this:This allows the generic type
Tto flow from up through the inheritance hierarchy such that the implementation ofSaveAsync(orSavein older versions of CSLA) is of typeChild.