title: Azure Table Storage: Use existing properties as PartitionKey and RowKey
body: <p>I have a model where existing fields already fits quite nicely for RowKey and PartitionKey but I don't know how to assign them and not have duplicate data. Consider this example:</p>
  <pre class="lang-cs prettyprint-override"><code>public class ClassA : ITableEntity
  {
      // My existing fields
      public string Id { get; set; }
      public string Receiver { get; set; }
      public DateTimeOffset? Received { get; set; }
  
      // ITableEntity fields
      public string PartitionKey { get =&gt; Receiver; set =&gt; Receiver = value; }
      public string RowKey { get =&gt; Id; set =&gt; Id = value; }
      public DateTimeOffset? Timestamp { get =&gt; Received; set =&gt; Received = value; }
      public ETag ETag { get; set; }
  }
  </code></pre>
  <p>This works but we get duplicate data as expected. Then I tried to add [IgnoreDataMember] to Id, Receiver and Received but then I cannot query using TableClient.QueryAsync(x =&gt; x.Id == &quot;...&quot;).</p>
  <p>Is there a way I can map the ITableEntity to my exisiting fields so I:</p>
  <ol>
  <li>Avoid having duplicate data</li>
  <li>Can query using my exisiting fields</li>
  </ol>
  <p>I'm using Azure.Data.Tables Version 12.4.0</p>