How to use Linq to check if a list of strings contains any string in a list

后端 未结 5 1556
别跟我提以往
别跟我提以往 2021-02-05 07:12

I\'m constructing a linq query that will check is a string in the DB contains any of the strings in a list of strings.

Something like.

query = query.Whe         


        
5条回答
  •  孤城傲影
    2021-02-05 07:40

    like this:

    List list = new List();
    list.Add("One");
    list.Add("Two");
    
     var result = query.Where(x => list.Contains(x.tags));
    

提交回复
热议问题