I'm trying to get results similar to SQL IN
clause in terms of LINQ with the help of Contains()
I'm doing the following:
listData.Where(pr => pr.CD.Contains(cd)).Select(pr => pr.dept_cd).Distinct()
This works if cd
is only one value, but not working when cd
is a comma-separated string.
How can I achieve SELECT * FROM TABLE WHERE COLUMN IN(VALUE1,VALUE2...)
in case of LINQ?