title: How can I parameterise Azure's TableOperation.Retrieve<TElement> in a method in c# .NET
body: <p>I have a class, something like the following:</p>
  
  <pre><code>public class Table : ITable
      {
          private CloudStorageAccount storageAccount;
          public Table()
          {
              var storageAccountSettings = ConfigurationManager.ConnectionStrings["AzureStorageConnection"].ToString();
              storageAccount = CloudStorageAccount.Parse(storageAccountSettings);
          }
          public async Task&lt;TableResult&gt; Retrieve(string tableReference, string partitionKey, string rowKey)
          {
              var tableClient = storageAccount.CreateCloudTableClient();
              var table = tableClient.GetTableReference(tableReference);
              TableOperation retrieveOperation = TableOperation.Retrieve&lt;SomeDomainModelType&gt;(partitionKey, rowKey);
              TableResult retrievedResult = await table.ExecuteAsync(retrieveOperation);
              return retrievedResult;
          }
      }
  </code></pre>
  
  <p>This class is a wrapper to retrieve a single entity from an Azure table. It's wrapped up and conforms to an interface so that it can be stubbed out with Microsoft Fakes during testing. It works at the moment, however it would be more elegant if the following was more generic:</p>
  
  <pre><code>TableOperation retrieveOperation = TableOperation.Retrieve&lt;SomeDomainModelType&gt;(partitionKey, rowKey);
  </code></pre>
  
  <p>My question is how can I parameterise <code>&lt;SomeDomainModelType&gt;</code> so that I can use the method with any type in the domain model ? Any ideas?</p>