title: nHibernate mapping to custom types
body: <p>I have a Oracle database and one of the fields is a date range field. It is basically just stored in the database as a VARCHAR(40) in the format YYYY/MM/DD-YYYY/MM/DD. I want to map it in nHibernate to a custom class I have created like this</p>
  
  <pre><code>public class DateTimeRange
  {
      public DateTimeRange(DateTime fromTime, DateTime toTime)
      {
          FromTime = fromTime;
          ToTime = toTime;
      }
  
      public override string ToString()
      {
          return String.Format("{0} to {1}", FromTime.ToString("HH:mm:ss"), ToTime.ToString("HH:mm:ss"));
      }
  
      public DateTime FromTime { get; set; }
  
      public DateTime ToTime { get; set; }
  }
  </code></pre>
  
  <p>How can I map to custom classes like this?</p>