Why is there a List<T>.Contains(T) method but no List<T>.Find(T) method? Only the Finds that support predicates are supported. If we have an existing instance of T populated with a property value for its ID (but missing other properties) why can’t we search by providing this object instance to the search in List, especially when we have implemented custom IEquatable<T> for T and would like to use what’s there. But as it is, we can’t, we have to repeat everything that we did in IEquatable implementation in our Find(predicate) call.
Why is there a List<T>.Contains(T) method but no List<T>.Find(T) method? Only the Find s
Share
You can call the
IEquatable<T>member(s) in yourPredicate<T>. Then you won’t be repeating yourself.