title: vb.net Class constructor of itself
body: <p>I have a wrapper class to help deserialize incoming json messages.
  At the moment I am using it like this.</p>
  
  <pre><code>Dim oXMessage As XMessage = JsonConvert.DeserializeObject(Of XMessage)(message)
  </code></pre>
  
  <p>I wanted to create a constructor for the class so I can instantiate it more cleanly. Like this</p>
  
  <pre><code>Dim oXMessage as XMessage = New XMessage(message)        
  </code></pre>
  
  <p>I have tried the below constructor but it does not work.
  Can someone point me in the right direction please?</p>
  
  <pre><code>Public Class XMessage
      &lt;JsonProperty("e")&gt; Public MessageType As String
      &lt;JsonProperty("data")&gt; Public MessageData As Object
      &lt;JsonProperty("ok")&gt; Public MessageOk As String
  
      Public Sub New(message As String)
          Me = JsonConvert.DeserializeObject(Of Me)(message)
      End Sub
  End Class
  </code></pre>