title: Delete Azure Elastic Pools if Empty
body: <p>In C# I am using the Azure fluent API <code>Microsoft.Azure.Management.Fluent</code> to manage resources. I want to be able to delete an Elastic Pool if it is empty (e.g. I have just ran a process that deletes a DB within it).</p>
  
  <pre class="lang-cs prettyprint-override"><code>azure.SqlServers.ElasticPools.DeleteBySqlServerAsync(...
  </code></pre>
  
  <p>However I have a separate process which depending on user actions might create a database within the pool. So I don't think it is safe for me to get the count of the databases within the pool then delete it if there are zero due to the race condition that might happen between.</p>
  
  <p>Is there anyway, using the Azure fluent api I can safety delete elastics pools only if there is no databases?</p>