LINQ: Entity string field contains any of an array of strings

后端 未结 3 1659
傲寒
傲寒 2020-12-01 04:28

I want to get a collection of Product entities where the product.Description property contains any of the words in a string array.

It would look something like this

3条回答
  •  情话喂你
    2020-12-01 04:52

    Dim result = From p in products _
                 Where search.Any(Function(s) p.Description.Contains(s))
                 Select p
    

提交回复
热议问题