When looking in NHProf this query results in 2 selects (both same)
using (ISession session = sessionManager.OpenSession())
{
  var query = (from order in session.Linq<Order>()
             where order.Status == criteria.OrderStatus
             select order)
  .Skip(criteria.From)
  .Take(criteria.MaxResult);

  orders = query.AsEnumerable();
}

whereas this one results in only one (same select as in the linq case)
using (ISession session = sessionManager.OpenSession())
{
  orders = session.CreateCriteria<Order>()
      .Add(Restrictions.Eq("Status", criteria.OrderStatus))
      .SetFirstResult(criteria.From)
      .SetMaxResults(criteria.MaxResult).List();
}

Any ideas?

NHibernate 2.1.0.1003
NHibernate Linq 1.0 (updated and built from trunk this morning)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to