title: How to safely check if a dynamic object has a field or not
body: <p>I'm looping through a property on a dynamic object looking for a field, except I can't figure out how to safely evaluate if it exists or not without throwing an exception.</p>
  
  <pre><code>        foreach (dynamic item in routes_list["mychoices"])
          {
              // these fields may or may not exist
             int strProductId = item["selectedProductId"];
             string strProductId = item["selectedProductCode"];
          }
  </code></pre>