As the error says, LINQ methods do not return List<T>
. If you need a List<T>
, you need to call ToList()
List<Literal> clashes = literals
.Where(lit => other.literals
.Any(lit2 => lit.Name.Equals(lit2.Name) && !lit.Sign.Equals(lit2.Sign)))
.ToList();