Scrum Meister, , , , . , , MyClass, , .
It looks like you really want to check and see if any instance of the MyClass object that is on this list has a Type property that matches your desired type.
For clarity, I would override the MyClass class as follows:
public class MyClass {
public Type MyType { get; set; }
public int Value { get; set; }
}
Then your condition will be:
if(myList.Any(x => x.MyType == typeof(SomeClass)) {
}
Hope this explains things a little clearer.
source
share