title: NHibernate Could not resolve property
body: <p>I am getting exception <code>NHibernate.QueryException</code> : <em>could not resolve property: InsuredId</em>. I am new to NHibernate and I could not figure it out.</p>
  
  <p>Defining Properties</p>
  
  <pre><code>public virtual int InsuredId { get; set; }
  public virtual string Gender { get; set; }
  public virtual DateTime DateOfBirth { get; set; }
  public virtual string SrId { get; set; }
  public virtual string SchoolId { get; set; }
  public virtual string Ssn { get; set; }
  public virtual DateTime GradDate { get; set; }
  </code></pre>
  
  <p>Mapping data to properties</p>
  
  <pre><code>public InsuredMap()
  {
       ReadOnly();
  
       Table("Insured");
       Id(x =&gt; x.Id, "InsuredId");
       Map(x =&gt; x.Gender, "SexCd");
       Map(x =&gt; x.DateOfBirth, "BirthDt");
       Map(x =&gt; x.SrId, "SIDIdNum");
       Map(x =&gt; x.SchoolId, "SchoolIdTxt");
       Map(x =&gt; x.Ssn, "SocSecNumTxt");
       Map(x =&gt; x.GradDate, "GradMthYrNum");
  }
  </code></pre>
  
  <p>Function to fetch all values </p>
  
  <pre><code>public Entities.Insured GetByInsuredId(int insuredId)
  {
      var query = Session.QueryOver&lt;Entities.Insured&gt;()
          .Where(x =&gt; x.InsuredId == insuredId)
          .Cacheable()
          .CacheRegion(Constants.EntityCacheRegion);
  
      return query.SingleOrDefault();
  }
  </code></pre>
  
  <p>Unit Test to test the data</p>
  
  <pre><code>[Test]
  public void InsuredMapTest()
  {
      var insured = repository.GetByInsuredId(714619800);
      Assert.That(insured.Gender, Is.EqualTo("F"));
  }  
  </code></pre>