title: NHibernate Projections.Cast to custom type
body: <p>My quantity column is an int. I want to use Like on it then i try to conver its type to string.</p>
  
  <p>To do this i use:</p>
  
  <pre><code> Expression.Like(
   Projections.Cast( NHibernateUtil.String,
   Projections.Property&lt;ErrorSummaryEntity&gt;(x =&gt; x.Quantity)),
   searchValue, MatchMode.Anywhere)
  </code></pre>
  
  <p>Its almost works. It generate sql like this.</p>
  
  <pre><code> cast( this_.ILOSC as NVARCHAR2(255)) like :p1
  </code></pre>
  
  <p>Problem here is <b>N</b>VARCHAR. I need to get VARCHAR instead.</p>
  
  <p>How can i get this?<code>cast( this_.ILOSC as VARCHAR2(255)) like :p1</code></p>
  
  <p>Second question that might help is:
  If i have mapping like this:</p>
  
  <p><code>Map(x =&gt; x.Quantity)
  .Column("ILOSC")</code></p>
  
  <p>Thats why i use lambda to work on this column.
  Is possible to retrieve maped column name?</p>
  
  <p><code>var colName = //some action to return "ILOSC"</code></p>
  
  <p><code>Projections.Property&lt;ErrorSummaryEntity&gt;(x =&gt; x.Quantity)</code> gives me "Quantity". How can i get "ILOSC"?</p>
  
  <p>If i get this column name i can use <code>Expression.Sql().</code></p>