title: nHibernate mapping generic IDictionary
body: <p>I've asked this elsewhere and not got any sensible reply</p>
  
  <p>I'm trying to map an IDictionary. I have this mapping:</p>
  
  <pre><code>&lt;class name="MyProject.Item, MyProject" table="Item"&gt; 
  &lt;...&gt;
  &lt;map name="Properties" access="property" table="ItemProperties" lazy="false"&gt; 
    &lt;key column="ItemID" /&gt; 
    &lt;index column="Idx" type="int" /&gt; 
   &lt;element column="Value" type="System.Boolean, mscorlib"/&gt; 
  &lt;/map&gt; 
  </code></pre>
  
  <p>I can persist data, but when the data is retrieved I get an nHibernate exception:
  {"The value "0" is not of type "Project.PropertyType" and cannot be used in this generic collection. Parameter name: key"} </p>
  
  <p>So it can't map to the enum, but why ? if I have a regular property that uses an enum, it works fine. </p>
  
  <p>Is what I'm trying to do even possible ? I can't find much info on doing this.</p>