title: NHibernate LINQ query throws error "Could not resolve property"
body: <p>I'm testing out using LINQ with NHibernate but have run into some problems with resolving string.length. I have the following </p>
  
  <pre><code>public class DC_Control
  {
      public virtual int ID { get; private set; }
      public virtual string Name { get; set; }
      public virtual bool IsEnabled { get; set; }
      public virtual string Url { get; set; }
      public virtual string Category { get; set; }
      public virtual string Description { get; set; }
      public virtual bool RequireScriptManager { get; set; }
      public virtual string TriggerQueryString { get; set; }
      public virtual DateTime? DateAdded { get; set; }
      public virtual DateTime? DateUpdated { get; set; }
  }
  
  public class DC_ControlMap : ClassMap&lt;DC_Control&gt;
  {
      public DC_ControlMap()
      {
          Id(x =&gt; x.ID);
          Map(x =&gt; x.Name).Length(128);
          Map(x =&gt; x.IsEnabled);
          Map(x =&gt; x.Url);
          Map(x =&gt; x.Category);
          Map(x =&gt; x.Description);
          Map(x =&gt; x.RequireScriptManager);
          Map(x =&gt; x.TriggerQueryString);
          Map(x =&gt; x.DateAdded);
          Map(x =&gt; x.DateUpdated);
      }
  }
  
  private static ISessionFactory CreateSessionFactory()
      {
          return Fluently.Configure()
              .Database(FluentNHibernate.Cfg.Db.MsSqlConfiguration.MsSql2008)
              .Mappings(m =&gt; m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()))
              .ExposeConfiguration(c =&gt; c.SetProperty("connection.connection_string", "CONNSTRING"))
              .ExposeConfiguration(c =&gt; c.SetProperty("proxyfactory.factory_class", "NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle"))
              .BuildSessionFactory();
      }
  
  public static void test()
      {
          using (ISession session = sessionFactory.OpenSession())
          {
              var sqlQuery = session.CreateSQLQuery("select * from DC_Control  where  LEN(url) &gt; 80").AddEntity(typeof(DC_Control)).List&lt;DC_Control&gt;();
  
              var linqQuery= session.Linq&lt;DC_Control&gt;().Where(c =&gt; c.Url.Length &gt; 80).ToList();
          }
      }
  </code></pre>
  
  <p>In my test method I first try and perform the query using SQL, this works just fine. Then I want to do the same thing in LINQ, and it throws the following error:</p>
  
  <pre><code>NHibernate.QueryException: could not resolve property: Url.Length of: DC_Control
  </code></pre>
  
  <p>I've searched alot for this "could not resolve property" error, but I can't quite figure out, what this means. Is this because the LINQ implementation is not complete? If so it's a bit disappointing coming from Linq2Sql where this would just work.</p>
  
  <p>I also tried it setting up the mapping with a hbm.xml instead of using FluentNHibernate but it produced teh same error.</p>