SearchExtensions icon indicating copy to clipboard operation
SearchExtensions copied to clipboard

ignore case for IQueryable

Open veezed opened this issue 9 years ago • 8 comments

Some databases, such as Postgre is case sensitive.

You could implement case insensitive queries for IQueryable, by using toLower before applying filter clause. I implemented it on my own branch on 'contains', I could share it here if you want.

There is small example: image

image

veezed avatar Dec 06 '16 07:12 veezed

This is certainly a good new feature. Be good to have it as a configurable option though. e.g.

context.Search(x => x.String1).CaseInsensitive().Contains("TeSt");

I'll can try and look at this in more detail and get something pushed through.

ninjanye avatar Jan 17 '17 16:01 ninjanye

Yes, I made it in my branch, it just have different name. In my project it's called IgnoreCase()

veezed avatar Jan 17 '17 16:01 veezed

That sounds good. Have you implemented it for all comparison methods (e.g. .StartsWith, .Contains, .EndsWith etc?) or just the contains method? If it's all done, feel free to submit a PR.

ninjanye avatar Jan 17 '17 16:01 ninjanye

Sorry, just Contains

veezed avatar Jan 17 '17 17:01 veezed

Hi! Where is a solution because I cannot find it? I want to have possibility to decide about case sensitive or case insensitive comparison especially when it comes to Containing. Thanks in advanced

PatryxCShark avatar Jun 26 '20 20:06 PatryxCShark

What Db engine do you use?

On Fri, 26 Jun 2020, 23:41 PatryxCShark, [email protected] wrote:

Hi! Where is a solution because I cannot find it? I want to have possibility to decide about case sensitive or case insensitive comparison especially when it comes to Containing. Thanks in advanced

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ninjanye/SearchExtensions/issues/15#issuecomment-650391038, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCD4FX2Q3UKRO6Q5VXSA3TRYUBYXANCNFSM4CYUPRZQ .

veezed avatar Jun 26 '20 20:06 veezed

MS SQL, but sometimes I have IQueryable which is done in memory. If I know is process on memory side, should I do IQueryable.AsEnumerable() and then use SetCulture?

PatryxCShark avatar Jun 26 '20 21:06 PatryxCShark

Ms sql is case insensitive. This change is required only for DB engines who are case sensitive, for example postgres sql.

On Sat, 27 Jun 2020, 00:03 PatryxCShark, [email protected] wrote:

MS SQL, but sometimes I have IQueryable which is done in memory. If I know is process on memory side, should I do IQueryable.AsEnumerable() and then use SetCulture?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ninjanye/SearchExtensions/issues/15#issuecomment-650400068, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCD4FUWVZE7P764AQ7KGQTRYUEKHANCNFSM4CYUPRZQ .

veezed avatar Jul 02 '20 13:07 veezed