Linq Select All Items Matching Array

后端 未结 1 1009
梦毁少年i
梦毁少年i 2021-01-04 06:25

I have a data collection of type IEnumerable containing labour records for various employees. I wish to filter the list and return on

相关标签:
1条回答
  • 2021-01-04 07:11

    You can filter your list with LINQ Where using Contains method:

    var result = list.Where(x => employees.Contains(x.EmployeeID));
    
    0 讨论(0)
提交回复
热议问题