title: dynamic query to azure tables
body: <p>I'm using azure table storage to store blog posts. Each blog post can have different tags.
  So I'm going to have three different tables. </p>
  
  <ul>
  <li>One which will store the blog posts.</li>
  <li>One to store the tags</li>
  <li>One that will store the relation between the tags and posts</li>
  </ul>
  
  <p>So my question is as following, is it possible to create dynamic search queuries? Because I do not know until at run time how many tags I want to search.
  As I understand it you can only query azure table using LINQ. Or can I input a string query that I can change dynamically?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Here's some example data that's in the blog table</p>
  
  <pre><code>PartitionKey,RowKey,Timestamp,Content,FromUser,Tags
  user1, 1, 2012-08-08 13:57:23, "Hello World", "root", "yellow,red"
  </code></pre>
  
  <p>blogTag table</p>
  
  <pre><code>PartitionKey,RowKey,Timestamp,TagId,TagName
  "red", "red", 2012-08-08 11:40:29, 1, red
  "yellow", "yellow", 2012-08-08 11:40:29, 2, yellow
  </code></pre>
  
  <p>relation table</p>
  
  <pre><code>PartitionKey,RowKey,Timestamp,DataId,TagId
  1, 1, 2012-08-08 11:40:29, 1, 1
  2, 1, 2012-08-08 13:57:23, 1, 2
  </code></pre>
  
  <p>One usage example of these tables is for example when I want to get all blog post with certain tag.</p>
  
  <ul>
  <li>I have to query the tagId from the blogTag table</li>
  <li>There after I need to search in the relation table for the dataId</li>
  <li>Lastly I need to search blog table for blog post with that dataId</li>
  </ul>
  
  <p>I'm using LINQ to perform the query and it looks like following</p>
  
  <pre><code>CloudTableQuery&lt;DataTag&gt; tagIds = (from e in ctx2.CreateQuery&lt;DataTag&gt;("datatags")
                                     where e.PartitionKey == tags
                                     select e).AsTableServiceQuery&lt;DataTag&gt;();
  </code></pre>
  
  <p>I tried Gaurav Mantri suggestion of using filter, and it works. But I'm afraid of how the effiency of that will be. And about the limitation of 15 discrete comparison that's only allowed.</p>