Serialize a Class that contains another Class with vb.net

Good Morning. Well as usual the weatherman got the stuff wrong with us. They predicted all this snow that didn’t materialize. But I should be used to it. Friends of mine tell me up north got hit much harder.

My Twitter experience is … just getting started I guess. I wish we had a way to import our Windows Live network there quickly. But it will be interesting to see how it goes.

Today’s topic is how to serialize a class that contains another class with vb.net. It’s a little different when generics are involved. Make it a great day!

<Groups>
<Group>
        <Field1 />
        <Field2 />
    </Group>
    <Group>
        <Field1 />
        <Field2 />
    </Group>
</Groups>

Private m_Group As New List(Of clsGroup)
[XmlArray("Groups")]
[XmlArrayItem("Group")]
    Public Property Group() As List(Of clsGroup)
        Get
            Return m_Group 
        End Get
        Set(ByVal value As List(Of m_Group))
            m_Group  = value
        End Set
    End Property

 

Technorati Tags: ,,,,,,,,,,,,

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: