title: How do I delete all files in an Azure File Storage folder?
body: <p>I'm trying to work how how to delete all files in a folder in Azure File Storage.</p>
  
  <p><code>CloudFileDirectory.ListFilesAndDirectories()</code> returns an <code>IEnumerable</code> of <code>IListFileItem</code>. But this doesn't help much because it doesn't have a filename property or similar.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>var folder = root.GetDirectoryReference("myfolder");
  
  if (folder.Exists()) {
      foreach (var file in folder.ListFilesAndDirectories()) {
  
          // How do I delete 'file'
  
      }
  }
  </code></pre>
  
  <p>How can I change an <code>IListFileItem</code> to a <code>CloudFile</code> so I can call <code>myfile.Delete()</code>?</p>