Exemple #1
0
 public async Task CanUseClassConstraintAsync()
 {
     using (ISession session = OpenSession())
     {
         var crit = session
                    .CreateCriteria(typeof(Animal), "a")
                    .Add(Property
                         .ForName("a.class")
                         .Eq(typeof(Animal)));
         var results = await(crit.ListAsync <Animal>());
         Assert.AreEqual(1, results.Count);
         Assert.AreEqual(typeof(Animal), await(NHibernateUtil.GetClassAsync(results[0])));
     }
 }