Its late so this may be a dumb question…
If Fish is a class (with no Equal/operator== overrides/overloads) and I want to get a specific fish matched on reference equality from a List or ObservableCollection of Fish(es) currently I do:
Fish found_fish1 = my_list.Find(f => f==search_fish);
Fish found_fish2 = my_observable_collection.FirstOrDefault(f => f==search_fish);
Is that the best way to do this? I was expecting an XXXX method that takes a Fish (similar to Remove) eg
Fish found_fish = my_observable_collection.XXXX(search_fish);
but just can’t seem to find it.
Since
found_fishis eithersearch_fishornull, you can useICollection<T>.Contains: