improvements of the json model

master
xieguigang 7 years ago
parent c37c4e4b2c
commit e47d826227

@ -31,8 +31,8 @@ Namespace TaskHost
''' Creates the function remote calls one of its parameter value.
''' </summary>
''' <param name="o"></param>
Sub New(o As Object)
Dim type As Type = o.GetType
Sub New(o As Object, Optional type As Type = Nothing)
type = If(type, o.GetType)
Me.type = type.FullName
Me.value = JsonContract.GetObjectJson(o, type)

@ -52,7 +52,10 @@ Namespace TaskHost
''' <summary>
''' The returns value.()
''' </summary>
Public Class Rtvl(Of T)
''' <remarks>
''' ,使
''' </remarks>
Public Class Rtvl
''' <summary>
''' 200 OK
@ -71,7 +74,7 @@ Namespace TaskHost
''' The result value in json string format
''' </summary>
''' <returns></returns>
Public Property info As T
Public Property info As Argument
Sub New()
End Sub
@ -83,24 +86,20 @@ Namespace TaskHost
Sub New(value As Object, type As Type)
errCode = HTTP_RFC.RFC_OK
info = JsonContract.GetObjectJson(value, type)
info = New Argument(value, type)
End Sub
''' <summary>
''' If the remote execute raising a exception, then a exception will be throw from this function.
''' If the remote execute raising a exception,
''' then a exception will be throw from this function.
''' </summary>
''' <param name="type"></param>
''' <returns></returns>
Public Function GetValue(type As Type) As Object
Public Function GetValue() As Object
If errCode <> HTTP_RFC.RFC_OK Then
Throw New Exception(ex)
Throw message.Exception
Else
Return info.GetValue()
End If
Return LoadObject(value, type)
End Function
Public Function GetValue(func As [Delegate]) As Object
Dim type As Type = func.Method.ReturnType
Return GetValue(type)
End Function
Public Shared Function CreateObject(Of T)(x As T) As Rtvl

Loading…
Cancel
Save