Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make class serializable

I search how to made this class serializable for a service (SOAP)

<Serializable()> _
    Public Class Items

        Inherits StringEnumBase(Of Items)
        Public Sub New(ByVal StrValue As String)
            MyBase.New(StrValue)
        End Sub

        <Description("item 1")> Public Shared ReadOnly ITEM1 As New Items("ValueOfItem1")
        <Description("item 2")> Public Shared ReadOnly ITEM2 As New Items("ValueOfItem2")
        <Description("item 3")> Public Shared ReadOnly ITEM3 As New Items("ValueOfItem3")

    End Class
like image 730
forX Avatar asked Feb 06 '13 22:02

forX


1 Answers

It's ok for the attribute, but it must have a public parameterless constructor.

like image 96
Oscar Avatar answered Oct 02 '22 06:10

Oscar