title: fluent nhibernate problem mapping char(1) type
body: <p>The map.</p>
  
  <pre><code>    public SocialCodeMap()
      {
          Id(x =&gt; x.SocialCodeId);
          Map(x =&gt; x.Name);
          Map(x =&gt; x.Code);
          Map(x =&gt; x.DisplayOrder);
      }
  </code></pre>
  
  <p>And the Class.</p>
  
  <pre><code>public class SocialCode
  {
      public virtual Guid SocialCodeId { get; set; }
      public virtual string Name { get; set; }
      public virtual char Code { get; set; }
      public virtual int DisplayOrder { get; set; }
  }
  </code></pre>
  
  <p>And the call.</p>
  
  <pre><code>    public SocialCode FetchByCode(char code)
      {
          return Session.CreateCriteria&lt;SocialCode&gt;().Add&lt;SocialCode&gt;(x =&gt; x.Code == code).UniqueResult&lt;SocialCode&gt;();
      }
  </code></pre>
  
  <p>I receive this error when running FetchByCode().</p>
  
  <pre><code>System.Exception: Cannot convert '65' to System.Char
  at NHibernate.LambdaExtensions.ExpressionProcessor.ConvertType(Object value, Type type)
  at NHibernate.LambdaExtensions.ExpressionProcessor.ProcessSimpleExpression(BinaryExpression be)
  at NHibernate.LambdaExtensions.ExpressionProcessor.ProcessBinaryExpression(BinaryExpression expression)
  at NHibernate.LambdaExtensions.ExpressionProcessor.ProcessLambdaExpression(LambdaExpression expression)
  at NHibernate.LambdaExtensions.ExpressionProcessor.ProcessExpression&lt;T&gt;(Expression`1 expression)
  at NHibernate.LambdaExtensions.ICriteriaExtensions.Add&lt;T&gt;(ICriteria criteria, Expression`1 expression)
  at DAL.NHibernate.xxx.SocialCodeRepository.FetchByCode(Char code) in SocialCodeRepository.cs: line 18
  at UnitTests.DAL.xxx.yyy.SocialCodeRepositoryFixture.FetchByCode_ReturnsNullCodeDNE() in SocialCodeRepositoryFixture.cs: line 38 
  </code></pre>
  
  <p>It seems NHibernate is convering my char to an int somewhere along the way. How can I force it to use the char(1) type that is on the column?</p>