You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhibernate-development
Fetch method in LINQ only seems to work if there is no select clause
statement.
"session.Query<Company>().Fetch(c => c.Employees).ToList()" works
fine.
However:
"session.Query<Company>().Fetch(c => c.Employees).Select(c =>
c).ToList()" which is the same as
"(from comp in session.Query<Company>().Fetch(c => c.Employees) select
comp).ToList()" throws a NotSupported exception.
This means you cannot have Fetch in any non-trivial queries.
Is this a known issue or I am doing something wrong? Entities are
simple and are mapped using camel-case fields.
Dmitry
unread,
Dec 24, 2010, 7:42:16 PM12/24/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhibernate-development
I got it. It should have been
(from comp in session.Query<Company>() select comp).Fetch(c =>
c.Employees).ToList()
It was not obvious to me because I am used to Entity Framework where
it works the other way.