title: Nullable Guid to Null during JSON Deserialization
body: <p><strong>Update:</strong> with the help of the answers below, I was able to see the error in my code and fix the problem.</p>
  
  <p>I'm trying to figure out why a <code>GUID?</code> is being set to null during deserialization.  I first saw this when <code>parentStepId</code> was set to null in the POST of my WebApi.  I verified that the JSON has the correct value for <code>parentStepId</code> on the client side.  To help track down what the problem is, I created a <code>JsonConverter</code>.    In the <code>JsonConverter</code> I can see that the JSON has the correct values before the conversion, but after the conversion <code>parentStepId</code> is set to null even though it has a valid <code>GUID</code> in the JSON.</p>
  
  <p>So what could be causing this or how can I work around this?</p>
  
  <p>On the client before the Ajax call is made and in the <code>JsonConverter</code>, the JSON looks like:</p>
  
  <pre><code>{
    "parentStepId": "c9ddfd7e-d124-e511-922d-ecf4bb4dc732",
    "workflowStep": {
      "enabled": true,
      "title": "9",
      "persistent": true,
      "extendable": false,
      "id": "00000000-0000-0000-0000-000000000000",
      "removeThisEntity": false,
      "deleteThisEntity": false,
      "serializeForServer": true
    },
    "order": 1,
    "id": "00000000-0000-0000-0000-000000000000",
    "removeThisEntity": false,
    "deleteThisEntity": false,
    "serializeForServer": true
  }
  </code></pre>
  
  <p>Here's the <code>ReadJson</code> of the converter:</p>
  
  <pre><code>public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
      {
          var jObject = JObject.Load(reader);
  
          //parentStepId is the expected value here
          var tmpVal = jObject == null ? string.Empty : jObject.ToString();
  
          //parentStepId is set to null during this deserialization.
          var res = JsonConvert.DeserializeObject&lt;OrderedWorkflow_WorkflowStep&gt;(tmpVal);
  
          return res;
      }
  </code></pre>
  
  <p>and the <code>OrderedWorkflow_WorkflowStep</code> class:</p>
  
  <pre><code>public class OrderedWorkflow_WorkflowStep : TbdOrderedEntity
  {
      public Guid? ParentWorkflowId { get; set; }
  
      public virtual WorkflowStep WorkflowStep { get; set; }
  
      public Guid? WorkflowStepId { get; set; }
  }
  </code></pre>