LINQ case sensitive

前端 未结 4 1986
挽巷
挽巷 2021-01-12 14:14

How to make LINQ case sensitive and NOT case sensitive depending on the situation?

I\'m using sql server 2008 and Entity Framework 4.0.

I changed the COLLATI

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-12 14:33

    query = query.Where(x => string.Equals(x.Name, Name, StringComparison.CurrentCultureIgnoreCase));
    

提交回复
热议问题