title: SharePoint get ContentType Name
body: <p>I am trying to get All Folders and Files from a <strong>SharePoint</strong> library, executing a single Request.</p>
  
  <pre><code>CamlQuery query = new CamlQuery();
  query.ViewXml = "&lt;View Scope='RecursiveAll' /&gt;";
  var libraryName = "Specific Documents";
  
  ListItemCollection itemsRaw = clientContext.Web.Lists.GetByTitle(libraryName).GetItems(query);
  clientContext.Load(itemsRaw);
  clientContext.ExecuteQuery();
  </code></pre>
  
  <p>This code works well, and as result I have a list of All Folders and Files within the specified library. </p>
  
  <p>It seems that the files details are loaded in a lazy manner. Only the first level from details hierarchy. But I don't know how, the <strong>FieldValues</strong> collection is filled with Data.</p>
  
  <p><img src="https://i.stack.imgur.com/PvRik.png" alt="ListItem details"></p>
  
  <p>I see that the <code>ListItem ContentType.Name</code> is not initialized. </p>
  
  <p><img src="https://i.stack.imgur.com/QX7SZ.png" alt="ContentType Name is not initialized"></p>
  
  <p>Is it possible somehow to update the query in a manner which will load the data for <strong>ContentType</strong> in this single call.</p>
  
  <p>Or the only possibility is to iterate through all files and do a load of ContentType for the specific file? </p>
  
  <p>I did this in the following way:</p>
  
  <pre><code>foreach(var listItem in listItemCollection)
  {
      context.Load(listItem, k =&gt; k.ContentType);
      context.ExecuteQuery();
      var contentTypeName = listItem.ContentType.Name;
  }
  </code></pre>
  
  <p>But I am going to get this information in a single call, If it is possible, without iterating in the collection and starting multiple calls to <strong>ClientContext</strong>.</p>
  
  <p><em>P.S.: I am new to <strong>SharePoint</strong> programming. I just want to fix a bug.</em>  </p>
  
  <p>Thanks!</p>