title: EntityObjectDatasource and where clause on Enum type field
body: <p>I have an <code>Entity</code> in my model which has an <code>Enumeration</code> type property.</p>
  
  <p>I'm binding a <code>Gridview</code> with an <code>EntityDataSource</code> to it. By now, everything is fine.</p>
  
  <p>But how can I specify a <code>WHERE</code> clause on a <code>MyEntity.MyEnumProperty</code>?</p>
  
  <p>Here is what I have tried so far:</p>
  
  <pre><code>Convert.ToInt32(it.MyEnumProperty) = @MyParam // Does not work
  CONVERT(it.MyEnumProperty AS INT) = @MyParam // Still does not work
  </code></pre>
  
  <p>I also tried to set <code>Int32</code> to <code>DbType</code> of my <code>params</code> for both these values but it fails. Also, I tried to bind it to a control or specifying a default value but it always fails saying it's impossible to convert a <code>String</code> value to <code>MyEnum</code>. </p>
  
  <p>I know it may be pretty simple but all my research on Google returned no answer about this.</p>