LINQ2SQL LIKE Command for Phrase

后端 未结 3 1219
傲寒
傲寒 2020-12-20 17:47

I am trying to retrieve a list of string where it contains \"Britney Spears\", and this is what I use

from p in Objects
where p.Title.Contains(\"Britney Spea         


        
3条回答
  •  借酒劲吻你
    2020-12-20 18:12

    You can use the SqlMethods.Like method for this purpose.

    from p in Objects
    where SqlMethods.Like(p.Title, "Britney% Spears")
    select p
    

提交回复
热议问题