Linq IN Operator

后端 未结 5 1710
北恋
北恋 2020-12-06 08:56

I\'ve tried searching for this but couldn\'t find examples that suited my situation.

I have this method for returning customers. How can I use the string array of co

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-06 09:55

    Try the following code:

    return g.Customers.Where(x => customerCodesArray.Contains(x.customerCode)).ToList(); 
    

提交回复
热议问题