title: dynamic c# ValueKind = Object
body: <p>As i'm trying to access <strong>object values</strong> using <strong>JsonSerializer.Deserialize</strong>  using debugger.<br>
  <a href="https://i.stack.imgur.com/NaMXf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NaMXf.png" alt="enter image description here" /></a></p>
  <p>Here is my result which i'm having below.<br></p>
  <pre><code>  OtpData = ValueKind = Object : &quot;{
          &quot;OTP&quot;:&quot;3245234&quot;,
          &quot;UserName&quot;:&quot;mohit840&quot;,
          &quot;type&quot;:&quot;SuperAdmin&quot;
      }&quot;
  </code></pre>
  <p>As i try to access it using <code>var Data = JsonSerializer.Deserialize(OtpData)</code> it gives me following error below.<br>
  <a href="https://i.stack.imgur.com/L62Kz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/L62Kz.png" alt="enter image description here" /></a></p>
  <p>How can i access the inside and get values of the following object.</p>
  <pre><code>&quot;OTP&quot;:&quot;3245234&quot;,
          &quot;UserName&quot;:&quot;mohit840&quot;,
          &quot;type&quot;:&quot;SuperAdmin&quot;
  </code></pre>
  <p><strong>Update :</strong></p>
  <pre><code>        [AllowAnonymous]
          [HttpPost(&quot;ValidateOTP&quot;)]
          public IActionResult ValidOTP(dynamic OtpData)
          {
              bool Result = false;
              var Data = JsonSerializer.Deserialize(OtpData);            
              if (OtpData.type == &quot;SuperAdmin&quot;)
              {
                  Users _Users = _Context.Users.FirstOrDefault(j =&gt; j.Username == &quot;&quot;);
                  if (_Users != null)
                  {
                      _Users.OTP = OtpData.OTP;                    
                      _Users.VerififedOTP = true;
                      _Context.SaveChanges();
                      Result = true;
                  }
              }
              else
              {
                  Staff _Staff = _Context.Staffs.FirstOrDefault(j =&gt; j.Username == &quot;&quot;);
                  if (_Staff != null)
                  {
                      _Staff.OTP = OtpData.OTP;                    
                      _Staff.VerififedOTP = true;
                      _Context.SaveChanges();
                      Result = true;
                  }
              }
  
              return Ok(new { Result = Result });
          } 
  </code></pre>
  <p><strong>Update 2:</strong>
  As i'm posting this by <strong>Postman application</strong>.</p>
  <pre><code>{
      &quot;OTP&quot;:&quot;3245234&quot;,
      &quot;UserName&quot;:&quot;mohit840&quot;,
      &quot;type&quot;:&quot;SuperAdmin&quot;
  }
  </code></pre>