title: Build sql query with string builder and a lot of parameters
body: <p>I am building my query using loops</p>
  
  <pre><code>for (var i = 0; i &lt;  query.BlackWhiteListFieldMatchProxy.Count; i++)
          {
              sb.Append($@"(
                                  MatchType = {(int)query.BlackWhiteListFieldMatchProxy[i].MatchType}
                          AND     EntityType = {(int)query.BlackWhiteListFieldMatchProxy[i].EntityType}
                          AND     MatchFieldType = {(int)query.BlackWhiteListFieldMatchProxy[i].MatchFieldType}
                          AND     (
                                      (
                                          MatchValue = '{query.BlackWhiteListFieldMatchProxy[i].MatchValue1}'
                                          OR MatchValue = {query.BlackWhiteListFieldMatchProxy[i].MatchValue2Or ?? "Null"}
                                      )
                                  AND
                                      (
                                          {query.BlackWhiteListFieldMatchProxy[i].MatchValue2And ?? "Null"} is Null
                                          OR MatchValue2 is Null
                                          OR MatchValue2 = {query.BlackWhiteListFieldMatchProxy[i].MatchValue2And ?? "Null"}
                                      )
                                   )
                            )");
  
              if (i != query.BlackWhiteListFieldMatchProxy.Count - 1)
                  sb.Append($@"
                              OR");
          }
  </code></pre>
  
  <p>But I have the problem with this</p>
  
  <pre><code>{query.BlackWhiteListFieldMatchProxy[i].MatchValue2And ?? "Null"} is Null
  </code></pre>
  
  <p>If it Null It'll work, otherwise the real value will be without ""</p>
  
  <p>The thing is I cant use something like</p>
  
  <pre><code>@MatchValue
  </code></pre>
  
  <p>Because I have the list of parameters with the same name which differs only by it's number in the List the names will be the same and It won't map it properly</p>