I have a list of strings that contain course codes, and a list of objects who have courseCode
as a property.
I'm trying to find a linq expression to compare the two, and let me know if there are any matches, at all, between the items in the list of strings and the courseCode properties in the list of objects.
I had a working expression moments ago and, long story short, I do not anymore and it's a miracle my laptop and monitors aren't in a million pieces :)
Below is my current best guess at the comparison. results
is the list of objects while coursesThatWork
is the list of strings. The expression below gives the error message
Cannot convert expression type 'System.Collections.Generic.IEnumerable to return type 'bool'
results.Where(x => coursesThatWork.Where(y => y.Equals(x.CourseCode))).Count() == 0