Hi,

 Our entities explicitly implement an interface which represents their
state. We explicitly cast the entities to this interface when excuting
a query and so far (for simple queries anyway) it seems to be working
out fine except in one regard: I can't order a query. For example, the
following query works:

var results = from x in session.Linq<MyEntity>()
                     where ((ISomeInterface)x).Name == "yadayada"
                     select x;

But the next one will throw a null ref exception when trying to
execute the criteria:

var results = from x in session.Linq<MyEntity>()
                     orderby ((ISomeInterface)x).Name
                     select x;

I built debug version of NH.Linq and can see it happening in the call
to RootVisitor.HandleOrderByCall but I'm such a Linq noob, I can't
make any progress on it.

I'm curious to know if this is ever going to work with the NH.Linq
provider or can anyone see pitfalls with using explicit interfaces in
long run? I.e. is this a bug or is it not supported and we've just
been lucky that non-orderd queries seem to execute fine

Cheers

--

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