Ah, ok. I had a similar requirement some time ago and I tried to solve
it by using the "is" operator and then casting (example: .Where(x =>
x.Foo is A && ((A)x).Label == "label"), but that resulted in the
following Jira issue:
http://216.121.112.228/browse/NH-2693

Maybe you can use that when it is fixed.

On Jun 22, 11:47 am, Giulio Petrucci <[email protected]>
wrote:
> On Wed, Jun 22, 2011 at 11:18 AM, cremor <[email protected]> wrote:
> > Can't you just use the following?
>
> > var result = session.Query<Bar>().Where(x => x.Foo.Something ==
> > "something").ToList();
>
> uhm... maybe I should have written something more. My bad. :-(
> Let's say my hierarchy is more like this:
>
> abstract class Foo {
>     string Something { ... }}
>
> class A : Foo {
>    string Label { ... }}
>
> class B : Foo {
>     string Widget { ... }}
>
> class C : Foo { }
>
> the user sets a list of strings and I have to check if Foo.Something,
> A.Label, B.Widget CONTAINS any of those strings, so I have to
> specialize the query clause to subtypes.
>
> Thanks,
> Giulio
>
> --

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