9

I have a Entity Framework entity with a string Property named Description.
Searching for all entities where the Description contains a string is as simple as:

var res = from u ctx.Users where u.Description.contains(str) select u;

But suppose I want to support case insensitive search?

CD..
  • 72,281
  • 25
  • 154
  • 163
sternr
  • 6,216
  • 9
  • 39
  • 63
  • 2
    possible duplicate of [linq to entities case sensitive comparison](http://stackoverflow.com/questions/3843060/linq-to-entities-case-sensitive-comparison) – xanatos Sep 14 '11 at 11:21
  • 1
    You can use the ToUpper() as I have written here http://stackoverflow.com/questions/5080727/string-equals-not-working-as-intended/5081892#5081892 – xanatos Sep 14 '11 at 11:21

1 Answers1

13

If you're using Linq to enties the search is done by the sql server so if the search is case sensitive or not depends on server settings.

Piotr Auguscik
  • 3,651
  • 1
  • 22
  • 30
  • 1
    And what about Oracle. If the dataAccess is built on top of EF because of Multi-RDBMS support. I can't resolve the problem on Oracle. – a.boussema Apr 25 '13 at 13:52
  • So there is no way to specify whether we want a case sensitive or case insensitive search using EF? – Zapnologica Jul 17 '16 at 11:06