开发者

ObservableCollection<MyCustomClass>.Contains(MyCustomObject.SomeProperty)

How can I extend 开发者_Python百科(or overload) Contains method with some custom property in a collection ?

I want that delegate to compare the object with just a property of it and returns true if there is an object with the same value of a property.


return myCollection.Any(myCustomObject => myCustomObject.SomeProperty.Equals(valueToFind));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜