It works, yes. The problem is, in one of my projects I decided to not
have ID properties on my entities.

Anyway, it should work, but I was asking about the "officially
recommended" way: better performance, more clear code etc.

thanks

ulu

On 12 янв, 03:32, Tuna Toksoz <[email protected]> wrote:
> .Where (p => p.Category.Id <http://p.category.id/> == categoryId)
>
> Doesn't this work?
>
> Tuna Toksöz
> Eternal sunshine of the open source mind.
>
> http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike
>
> On Mon, Jan 11, 2010 at 10:34 PM, ulu <[email protected]> wrote:
> > Hi,
>
> > What is the recommended way of using the new Linq provider? I'm using
> > the trunk version and trying to do a simple thing: fetch entities by a
> > foreign key.
>
> > So, I've got the Product class and it has the Category property. How
> > do I fetch all products given a categoryId?
> > .Where (p => p.Category.Id == categoryId)
> > or
> > .Where (p => p.Category == session.Load<Category>(categoryId)
> > ?
>
> > Thanks
>
> > ulu
>
> > --
> > 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.


Reply via email to