base class definition
Namespace result Public MustInherit Class result Public Sub New() End Sub Property msg As String Property success As Boolean End Class End Namespace
Define the function implementation:
Shared Function ResultT(Of T As Models.result.result)(msg As String) As T Dim rsp As T = Nothing Dim parser As Models.result.result = Nothing rsp.msg = msg rsp.success = False Return rsp 'Return New API.Resultobj(Of T) With {.msg = msg, .success = False} End Function
Example of calling:
Return ResultT(Of Models.result.httputil)(msg)