These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: NHibernate.Linq and string comparison
PostPosted: Sun Feb 28, 2010 12:51 pm 
Newbie

Joined: Thu Mar 30, 2006 2:10 pm
Posts: 14
NHibernate: 2.1.2GA
NHibernate.Linq: 2.1.2

Hello,

Was wondering when the following will be supported:

"var result = from person in Session.Linq<Person> where person.Name.ToLower() == name.ToLower() select person"

Throws index out of range exception ...

Simple non-case sensitive comparisons seems like a vital element that has been overlooked?

Appreciate your efforts, great framework.

Cheers,
Timothy Grant Vogelsang


Top
 Profile  
 
 Post subject: Re: NHibernate.Linq and string comparison
PostPosted: Mon Mar 01, 2010 9:10 pm 
Newbie

Joined: Mon Mar 01, 2010 9:08 pm
Posts: 1
Code:
var result = from person in Session.Linq<Person> where person.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase) select person;


I've not tried it with culture sensitivity. YMMV.


Top
 Profile  
 
 Post subject: Re: NHibernate.Linq and string comparison
PostPosted: Tue Mar 02, 2010 5:35 am 
Newbie

Joined: Sat Feb 27, 2010 9:26 pm
Posts: 5
I have the same problem.

Code:
var result = from person in Session.Linq<Person> where person.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase) select person;

that does not work!?

Has anybody a solution?


Top
 Profile  
 
 Post subject: Re: NHibernate.Linq and string comparison
PostPosted: Sat Mar 06, 2010 1:08 pm 
Newbie

Joined: Thu Mar 30, 2006 2:10 pm
Posts: 14
Any update? I've had to revert back to NHibernate Criteria in the places I need string comparisons in LINQ.

Cheers


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.