title: C# - CosmosDB Query Definition array_contains
body: <p>I have the following query in my cosmosdb database:</p>
  <pre><code>SELECT * FROM c WHERE ARRAY_CONTAINS(c.AlertsConfiguration, {&quot;Code&quot;:@alertCode, &quot;isEnabled&quot;:true}, true)
  </code></pre>
  <p>which is working well.</p>
  <p>The problem is that I need to execute this query from my C# project and I do it this way:</p>
  <pre><code> var results = new List&lt;User&gt;();
  
   var queryResult = _usersContainer.GetItemQueryIterator&lt;User&gt;(new QueryDefinition(QueryHelper.GetUsersForAlert)
                      .WithParameter(&quot;alertCode&quot;, alertCode));
  
                  while (queryResult.HasMoreResults)
                  {
                      var response = await queryResult.ReadNextAsync();
  
                      results.AddRange(response.ToList());
                  }
  
                  return results;
  </code></pre>
  <p>the <code>GetUsersForAlert</code> query is this one:</p>
  <pre><code>$&quot;SELECT * FROM c WHERE ARRAY_CONTAINS(c.AlertsConfiguration, {{'Code':@alertCode, 'isEnabled':true}}, true)&quot;;
  </code></pre>
  <p>When I execute it on the code it returns a Bad request 400 error</p>
  <p>I'm sure the problem is in this last syntaxis, I've tried several ways but I always get error, any ideas on this?</p>