ninjanye / SearchExtensions

Library of IQueryable extension methods to perform searching
MIT License
330 stars 52 forks source link

ignore case for IQueryable #15

Open veezed opened 7 years ago

veezed commented 7 years ago

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

ninjanye commented 7 years ago

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.

veezed commented 7 years ago

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

ninjanye commented 7 years ago

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.

veezed commented 7 years ago

Sorry, just Contains

PatryxCShark commented 4 years ago

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

veezed commented 4 years ago

What Db engine do you use?

On Fri, 26 Jun 2020, 23:41 PatryxCShark, notifications@github.com 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 .

PatryxCShark commented 4 years ago

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?

veezed commented 4 years ago

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, notifications@github.com 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 .