Reputation: 29
I don't know what to put above the variable to make deserialize the object and I can't find it anywhere... (I don't want to use json.net)
here's the class code
<Serializable()> _
Public Class O
<???????()> _
Private Likes As Decimal
Public Sub New(ByVal l As Decimal)
Likes = l
End Sub
End Class
and here's the main code
Dim ser As New DataContractJsonSerializer(GetType(O))
Dim ms As New MemoryStream(Encoding.UTF8.GetBytes(resp))
Dim o As O= CType(ser.ReadObject(ms), O)
ms.Close()
ms.Dispose()
So what should I put instead of ????
Upvotes: 0
Views: 84
Reputation: 101052
You have to make the Likes
member public.
Public Class O
Public Likes As Decimal
Public Sub New(ByVal l As Decimal)
Likes = l
End Sub
End Class
Upvotes: 1