You are correct. ICollection does not implement IQueryable, only IEnumerable.
On Thu, Aug 26, 2010 at 12:50 PM, Trinition <[email protected]> wrote: > I was curious if LINQ'ing against a lazy-loaded collection would > smartly query like it does when using the INHibernateQueryable, so I > did a test. I believe my results show that it still loads the list, > but I want to explain my thinking and results here to see if I'm on > the right track. > > I'm storing Customers and Transactions. I have a Customer entity, and > it in turn has an ICollection<Transaction> property named > Transactions. > > If I do "myCustomer.Transactions.Count(txn => txn.Amount > 100)", the > generated SQL shows it selecting all transactions for that customer > ID. > > However, if I do "myNHibernateQueryable.Count(txn => txn.Amount > > 100)", the generated SQL shows it selecting only those transactions > where the amount is greater than 100. > > Do my observations seem correct? > > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- 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.
