Case insensitive search using $in clause in Linq expressions

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.3
    • Component/s: LINQ
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hi guys,

      It would be very useful to support case insensitive search using $in clause in Linq expressions. For example it might be done in this way:

      Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      var goodValues = new string[] { ... }
      var query = collection.AsQueryable<T>()
          .Where(i => goodValues.Contains(i.SomeField.ToLower()));
      

      Right now it's only possible to specify general values in the array and is not possible to specify regex values for case insensitive search. General equal clause suports it via ToLower() etc methods, but the driver throw an exception if there is a call of .ToLower() method inside the array.Contains() method in .Where() expression.

      Thanks,
      Mikhail

            Assignee:
            Robert Stam
            Reporter:
            Mikhail Belov
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: