Funnily enough, the exception is thrown only when passing Expression<Func<TEntity, bool>>to the Where method. When passing Func<TEntity, bool> it works like a charm.
BTW- is it possible this is due to the fact I'm using an older version (1.0.0..)? On Nov 16, 4:04 pm, Nieve <[email protected]> wrote: > Thanks for the prompt reply Graham. > I did actually think of that, but wasn't sure how can this be done > since the substring is called on the user of the where clause, that is > if I set all the users names to their substring my query will give me > all the users with "shortened" names... Again, any ideas would be > highly appreciated! > > On Nov 16, 3:59 pm, Graham Bunce <[email protected]> wrote: > > > set the substring outside the call? > > > NH-Linq can be a bit flaky sometimes > > > On Nov 16, 2:45 pm, Nieve <[email protected]> wrote: > > > > Hello all, > > > I'm using Linq-to-nh and when I do > > > query.Where(user => names.Contains(user.Name.Substring(0, 2))); > > > I get a null reference exception. > > > Any idea how this should be done and/or what's wrong in my code? Cause > > > when I remove the Substring the query passes just fine... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
