title: Automapper map predefined value in .net
body: <p>I am trying to map string value fields from MongoDB to integers in VisualStudio, using .NET. The fields have one of a few known values, like &quot;pedestrian&quot;, &quot;bicycle&quot;, &quot;car&quot;. How can i check against these values and map them to be represented by &quot;0&quot;, &quot;1&quot;, &quot;2&quot;? I know the basics of automapper, but i cant find how to do this.
  I am getting them as a List&lt;&gt; and they need to stay as a List&lt;&gt;.</p>
  <p>Using:</p>
  <ul>
  <li>VS 19</li>
  <li>Automapper v8</li>
  </ul>
  <p>Example of a MongoDB document:</p>
  <pre><code>{
    &quot;Street&quot; : &quot;Oak&quot;,
    &quot;Object&quot; : &quot;pedestrian&quot;,
    &quot;Id&quot; : &quot;046b6c7f-0b8a-43b9-b35d-6489e6daee91&quot;,
    &quot;City&quot; : &quot;NY&quot;,
    &quot;Direction&quot; : 0
  }
  </code></pre>