title: Deserializing JSON into byrefrence ParametrizedConstructor object with Json.NET
body: <p>Below is my JSON formated String </p>
  
  <p>{"AliasName": "ysiCountryInfo", "DataClass": {"Description":"United States 111","Code":"usa","WriteOffTaxPointAdjustment":0,"IndexationRounding":6}}</p>
  
  <p>I would like to deserialize object into below class</p>
  
  <p>Option Explicit On
  Option Strict On</p>
  
  <p>Imports BaseApp.ysiBaseData
  Imports Common.DataClasses
  Imports Systems</p>
  
  <p>Namespace DataClasses</p>
  
  <pre><code>Public Class JSONFormatClass(Of ItemType)
  
      Private _Alias As String
      Public Property AliasName() As String
          Get
              Return _Alias
          End Get
          Set(ByVal value As String)
              _Alias = value
          End Set
      End Property
  
      Private _DataClass As ItemType
      Public Property DataClass() As ItemType
          Get
              Return _DataClass
          End Get
          Set(ByVal value As ItemType)
              _DataClass = value
          End Set
      End Property
  
  End Class
  </code></pre>
  
  <p>End Namespace</p>
  
  <p>Where Property "DataClass" is type of any class from "Common.DataClasses".</p>
  
  <p>And all class in this has Parametrized constructor which accept ByRef LoginCredential Object.</p>
  
  <p>And My Code is below:</p>
  
  <p>Dim loginData As New ysiLoginData()</p>
  
  <pre><code>   With loginData
       .Server = "xxxxx"
       .Platform = ServerType.SqlServer
       .Database = "xxxx"    
       .UserName = "xx"
       .Password = "xxxxx"
       .DeveloperMode = True
    End With
  </code></pre>
  
  <p>Dim SessionKey As New ysiSessionKey(loginData)</p>
  
  <p>Dim strJSON As String = HttpUtility.UrlDecode(context.Request.Form.ToString())</p>
  
  <p>Dim objJSON As JSONFormatClass(Of ysiCountryInfo) = JsonConvert.DeserializeObject(Of JSONFormatClass(Of ysiCountryInfo))(strJSON)</p>
  
  <p>json string format : {"AliasName": "ysiCountryInfo", "DataClass": {"Description":"United States 111","Code":"usa","WriteOffTaxPointAdjustment":0,"IndexationRounding":6}}</p>
  
  <p>here "ysiCountryInfo" is class type into which i would like to convert my "DataClass" property. "ysiCountryInfo" has parametrized constructor  which requires parameter of "ysiSessionKey" by ref.</p>
  
  <p>Dim objCountryInfo as New ysiCountryInfo(ysiSessionKey)</p>
  
  <p>I am getting Error into JsonSerializerInternalReader.js file of JSON at line # 808</p>
  
  <p>object createdObject = contract.ParametrizedConstructor.Invoke(constructorParameters.Values.ToArray());</p>
  
  <p>Because constructorParameters.Values is Null</p>
  
  <p>Please help me to solve this problem ASAP. </p>
  
  <p>Thanks 
  Dhiren Mistry</p>