title: Extension Method usage in .NET Core 2.0?
body: <p>I'm trying to use the Microsoft.Azure.Management.Compute <a href="https://docs.microsoft.com/en-gb/dotnet/api/microsoft.azure.management.compute.computemanagementclient?view=azure-dotnet" rel="nofollow noreferrer">ComputeManagementClient</a>  <code>Usage</code> property to list all resource usage through Azure.</p>
  
  <p>I'm specifically using <code>Usage.ListAsync()</code> to achieve this. According to the <a href="https://docs.microsoft.com/en-gb/dotnet/api/microsoft.azure.management.compute.iusageoperations?view=azure-dotnet#Applies_to" rel="nofollow noreferrer">documentation</a> this is an extension method. </p>
  
  <p>I'm calling the extension method after creating an instance of the ComputeManagementClient using the below:</p>
  
  <pre><code>    public async Task&lt;IComputeUsage&gt; GetResourceUsage(int customerId)
      {
          var azureClient = _dbContext.CreateAzureComputeClient(customerId);
  
          var usageReport = await azureClient.Usage.ListAsync();
      }
  </code></pre>
  
  <p>However, this is returning the following error: </p>
  
  <p><code>'IUsageOperations' does not contain a definition for Listasync and the best extention method overload ProvidersOptionsExtensions.ListAsync... Requires a receiver of type 'IProvidersOperations'</code>. </p>
  
  <p>Is this a bug, or am I calling the method incorrectly? </p>
  
  <p>Edit: I am using the correct namespaces in my code: </p>
  
  <pre><code>using System.Threading.Tasks;
  using Microsoft.Azure.Management.Compute;
  using Microsoft.Azure.Management.ResourceManager.Fluent;
  using Microsoft.Azure.Management.Compute.Fluent;
  </code></pre>
  
  <p>However, VS2017 doesn't indicate the namespace usage (Grey, rather then black colour). </p>