The 'is' operator syntax is nicer too, so in the trunk you can now write:
var entity = Repository.Session
.QueryOver<ToyBox>()
.Where(tb => tb is Circle)
...
(note - this change was only for QueryOver)
From: Richard Brown (gmail)
Sent: Saturday, September 11, 2010 1:32 PM
To: [email protected]
Subject: Re: [nhusers] Re: <Any/> Query with Linq
Hi Michael,
I think the syntax you'd want for QueryOver is:
var entity =
Repository.Session
.QueryOver<ToyBox>()
.Where(tb => tb.GetType() == typeof(Circle))
.SingleOrDefault();
2-I dont like your QueryOver query Where(x => x.Shape == new Circle { Id =
1 })) ... Its feel just wrong.
var entity = Repository.Session.QueryOver<ToyBox>()
.Where(x => x.Shape == new Circle { Id =
1 }).SingleOrDefault();
--
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.