List<int> ids = new List<int> {1,2,3};
var entitiesQuery = from e session.Query<MyEntity> where ids.Contains(e.Id);

will generate a different tree than
IList<int> ids = new List<int> {1,2,3};
var entitiesQuery = from e session.Query<MyEntity> where ids.Contains(e.Id);


On Wed, Sep 22, 2010 at 6:46 AM, Stefan Wenig <[email protected]>wrote:

> From a LINQ point of view, there's only IQueryable and IEnumerable,
> IQueryable being preferred in overloads since it's more specific.
> Concrete types make no difference.
>
> But maybe I misunderstood. Can you provide an example?
>
> On Sep 22, 11:30 am, Fabio Maulo <[email protected]> wrote:
> > Ah... in this case items should be a List not a IList nor ICollection...
> > I'm not sure but seems that using interfaces re-linq generates a
> different tree.
> >
> > --
> > Fabio Maulo
> >
> > El 22/09/2010, a las 06:23, Stefan Wenig <[email protected]>
> escribió:
> >
> >
> >
> > > PS: if that's not supported, you can also try
> > > var score = from s in NHibernateSession.Linq<Score>()
> > >   where items.Contains (s.Item)
> > >   select s;
> >
> > > On Sep 22, 11:03 am, Stefan Wenig <[email protected]> wrote:
> > >> This would be the correct code:
> >
> > >> IList<Item> item = FromSomeSource();
> > >> var score = from s in NHibernateSession.Linq<Score>()
> > >>    join i in items on s.Item equals i
> > >>   select s;
> >
> > >> Looks weird, but the thing is:
> > >> - If you have a query source and join an in-memory collection to it,
> > >> you create a query that receives the collection.
> > >> - If you have an in-memory collection and join a query to it, the
> > >> query is executed and then joined to the collection.
> > >> Don't know if NH's LINQ provider supports this though (re-linq does).
> >
> > >> Technically, the reason is the parameter list of Queryable.Join:
> > >> IQueryable<TOuter>, IEnumerable<TInner>. One could just create a new
> > >> extension method that supports the other way too, but I'd be careful
> > >> with that kind of ideas ;-)
> >
> > >> Cheers,
> > >> Stefan
> >
> > >> On Sep 22, 12:02 am, Scott <[email protected]> wrote:
> >
> > >>> Can someone tell me why when I use the NHibernate Linq inhibitor it
> > >>> gets the entire table when I trace it in Sql Profiler and if I use it
> > >>> in the from it gets the entire table 1 record at a time.
> >
> > >>> Simple query
> >
> > >>> IList<Item> item = FromSomeSource();
> > >>> var score = (from i in items
> > >>>   join s in NHibernateSession.Linq<Score>() on i equals s.Item
> > >>>   select s);- Hide quoted text -
> >
> > >> - Show quoted text -
> >
> > > --
> > > 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 athttp://
> groups.google.com/group/nhusers?hl=en.- Hide quoted text -
> >
> > - Show quoted text -
>
> --
> 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.
>
>


-- 
Fabio Maulo

-- 
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