Contains is the way forward:
var chiLst = new List<string>(); var parRec = Lnq.attlnks.Where(a => chiList.Contains(a.sysid)) .Select(a => a.ownerid);
Although you will be better off with a HashSet<string> instead of a list, in terms of performance, considering all the availability checks. (Suppose there will be quite a few entries ... for a small number of values, this will not matter much anyway, and the List<string> may even be faster.)
Note that in the performance aspect, it is assumed that you use LINQ for objects for this - if you use something like LINQ to SQL, it does not matter, since the Contains check will not be performed in the process anyway.
Jon skeet
source share