LINQ: "contains" and a Lambda query

.net, c#, lambda, linq, list

Solution

Use `Any()` instead of `Contains()`:

buildingStatus.Any(item => item.GetCharValue() == v.Status)

Problem

I have a `List<BuildingStatus>` called `buildingStatus`. I'd like to check whether it contains a status whose char code (returned by `GetCharCode()`) equals some variable, `v.Status`. Is there some way of doing this, along the lines of the (non-compiling) code below? ``` buildingStatus.Contains(item => item.GetCharValue() == v.Status) ```

Original source