title: Why does ASP.Net Core Web API return a partial resut for my object?
body: <p>I am trying to get my full object to be returned from my Core ASP.Net WebAPI method.</p>
  
  <p>I've been thinking this whole time I was not selecting my object correctly with my includes or there was something wrong with our patterns.
  But now I notice if I place my breakpoint right before returning the object, the complete object is there from my query and ready for me to return.</p>
  
  <p>So this is the method:</p>
  
  <pre><code>    [HttpPost]
      public async Task&lt;Case&gt; AddCase([FromBody] EmployeeCaseFromBodyModel model)
      {
          Case employeeCase = new Case()
          {
              PrimaryEmployeeId = model.EmployeeId,
              LerSpecialistId = model.LerSpecialistId,
              InitialContactId = model.InitialContactId,
              InitialConsultDate = model.InitialConsultDate,
              Notes = model.Notes
          };
  
          Case newCase = await _caseGenericService.InsertAsync(employeeCase);
  
          newCase.EmployeeCases = new List&lt;EmployeeCase&gt;();
          newCase.EmployeeCases.Add(new EmployeeCase
              {
                  CaseId = newCase.Id,
                  EmployeeId = model.EmployeeId
              }
          );
          await _caseGenericService.UpdateAsync(newCase);
  
          newCase = await _caseGenericService.GetSingleIncludingAsync(newCase.Id,
              new Expression&lt;Func&lt;Case, object&gt;&gt;[] {
              a =&gt; a.InitialContact,
              b =&gt; b.LerSpecialist
          });
  
          return newCase;
      }
  </code></pre>
  
  <p>If I place my breakpoint at this line:</p>
  
  <pre><code>return newCase;
  </code></pre>
  
  <p>The object looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/bPy18.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bPy18.png" alt="enter image description here"></a></p>
  
  <p>So see my object is populated even with deep properties.</p>
  
  <p>But the API Post returns this JSON result:</p>
  
  <pre><code>{
    "initialContactId": 2,
    "initialContact": {
      "email": "test@hrsa.gov",
      "organizationId": 1,
      "supervisor": "Beth Dillon",
      "supervisorEmail": "supervisor@hrsa.gov",
      "firstName": "Cindy",
      "lastName": "Adams",
      "notes": "Notes 2",
      "bargainingUnitId": 1,
      "payPlanId": 8,
      "gradeRankId": 5,
      "positionTitleId": 25,
      "seriesId": 2,
      "isUnionEmployee": true,
      "organization": null,
      "bargainingUnit": null,
      "payPlan": null,
      "gradeRank": null,
      "positionTitle": null,
      "series": null,
      "unionHours": null,
      "unionEmployeeYesNo": "Yes",
      "employeeCases": [
        {
          "employeeId": 2
        }
      ]
    }
  }
  </code></pre>
  
  <p>It only returns the InitialContactID and the IntitialContact with all of the properties filled for intialContact.
  But no LerSpecialist and no top level simple properties like Id and IntitialConsultDate?</p>
  
  <p>Why does it behave like this?</p>
  
  <p>Shouldn't it return the exact complete object I tell it too?</p>
  
  <p>I also tried making the return type a Task of IActionResult instead of Task Case and returning an ObjectResult instead of a Case.
  But no go.</p>