title: documentdb query using enums as filter
body: <p>I have below query (with complete code) not returning any data when there are in face rows that match that criteria. Are enums not supported in documentdb query?</p>
  
  <pre><code>        var query = _client.CreateDocumentQuery&lt;Job&gt;(CollectionUri, new FeedOptions()
          {
              MaxItemCount = 1
          })
          .Where(m =&gt; m.State != State.Done)
          .AsDocumentQuery();
  
          var docs = new List&lt;Job&gt;();
          while (query.HasMoreResults)
          {
              try
              {
                  foreach (var p in await query.ExecuteNextAsync&lt;Job&gt;())
                  {
                      docs.Add(p);
                  }
              }
              catch (DocumentClientException e)
              {
                  if (e.StatusCode == HttpStatusCode.NotFound)
                  {
                      return docs;
                  }
                  throw;
              }
          }
          return docs;
  </code></pre>
  
  <p>I just get docs as an empty list, no exceptions. State is an enum defined like below - </p>
  
  <pre><code>[JsonConverter(typeof(StringEnumConverter))]
  public enum State
  {
      ToProcess,
      Run,
      Done
  }
  
  
  
   public class Job {
       [JsonProperty("id")]
       public string Id {get; set;}
  
       public State State {get;set;}
   }
  </code></pre>
  
  <p>EDIT:
  I tried changing where clause as below - </p>
  
  <pre><code>.Where(m =&gt; m.State.ToString() != State.Done.ToString())
  </code></pre>
  
  <p>But this doesn't work too and I get an error that "Method 'ToString' is not supported."</p>
  
  <p>EDIT 2: corrected the typo where I inteded to say I had .ToString() in the EDIT above</p>
  
  <p>EDIT 3: 
  More information: </p>
  
  <p>I am using default serialization to have camel casing in the documents as below </p>
  
  <pre><code>        JsonConvert.DefaultSettings = () =&gt; new JsonSerializerSettings()
          {
              ContractResolver = new CamelCasePropertyNamesContractResolver()
          };
  </code></pre>
  
  <p>this converts all the columns also in camel casing.</p>
  
  <p>The actual query generated by LINQ is below - </p>
  
  <pre><code>{{"query":"SELECT * FROM root WHERE (root[\"State\"] != \"Done\") "}}
  </code></pre>
  
  <p>Hence there is column mismatch "State" vs "state".</p>
  
  <p>Below is a sample document in document db</p>
  
  <pre><code>{
  "id": "2017-03-02T22:00:00Z",
  "state": "ToProcess"
  }
  </code></pre>