开发者

Entity Framework and Case Insensitive String Search

开发者 https://www.devze.com 2023-04-04 23:46 出处:网络
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:

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 t开发者_C百科o support case insensitive search?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消