title: ServiceStack Ormlite Deserialize Array for In Clause
body: <p>I am storing some query criteria in the db via a <code>ToJson()</code> on the object that contains all the criteria.  A simplified example would be:</p>
  
  <pre><code>{"FirstName" :[ {Operator: "=", Value: "John"}, { Operator: "in", Value:"    ["Smith", "Jones"]"}], "SomeId": [Operator: "in", Value: "[1,2,3]" }]}
  </code></pre>
  
  <p>The lists are either string, int, decimal or date.  These all map to the same class/table so it is easy via reflection to get <code>FirstName</code> or <code>SomeId</code>'s type.</p>
  
  <p>I'm trying to create a where clause based on this information:</p>
  
  <pre><code> if (critKey.Operator == "in")
   {
     wb.Values.Add(keySave + i, (object)ConvertList&lt;Members&gt;(key, 
    (string)critKey.Value));
     wb.WhereClause = wb.WhereClause + " And {0} {1} (@{2})".Fmt(critKey.Column, 
    critKey.Operator, keySave + i);
  }
  else
  {
    wb.Values.Add(keySave + i, (object)critKey.Value);
    wb.WhereClause = wb.WhereClause + " And {0} {1} @{2}".Fmt(critKey.Column, critKey.Operator, keySave + i);
  }
  </code></pre>
  
  <p>It generates something like this (example from my tests, yes I know the storenumber part is stupid): </p>
  
  <pre><code>  Email = @Email0 And StoreNumber = @StoreNumber0 And StoreNumber in (@StoreNumber1)
  </code></pre>
  
  <p>I'm running into an issue with the lists.  Is there a nice way to do this with any of the ormlite tools instead of doing this all by hand?    The where clause generates fine except when dealing with lists. I'm trying to make it generic but having a hard time on that part.</p>
  
  <p>Second question maybe related but I can't seem to find how to use parameters with <code>in</code>.  Coming from NPoco you can do <code>(colum in @0</code>, somearray)` but I cant' seem to find out how to do this without using Sql.In.</p>