What is the problem with the code below?
var newContextElementCollection = new List<NewContextElements>();
var res = from eleCollection in newContextElementCollection
where eleCollection.Property.Except(new List<string> { "Password", "Some Other Value" })
select eleCollection;
The NewContextElementCollection
class:
public class NewContextElements
{
public string Property { get; set; }
public string Value { get; set; }
}
I am getting this error:
Instance argument: cannot convert from 'string' to 'System.Linq.IQueryable' Error 2 'string' does not contain a definition for 'Except' and the best extension method overload 'System.Linq.Queryable.Except(System.Linq.IQueryable,
System.Collections.Generic.IEnumerable)' has some invalid arguments