title: How to set the value of a property to null using reflection
body: <p>I want to set the value of <strong>LastName</strong> to null using reflection. </p>
  
  <pre><code>public void SetPropertyValueToNull(Type t)
  {
      PropertyInfo prop = t.GetProperty("LastName");
      prop.SetValue(t, null, null);
  }
  </code></pre>
  
  <p>I am passing <strong>typeof(User)</strong> as the parameter from another class where <strong>User</strong> is a model class which has <strong>LastName</strong> as one of the properties.
  It gives me <strong>Object does not match target type</strong> error. 
  <p>How can I resolve this issue?</p>