基本上,我該如何做到這一點,所以我可以做類似於:CurrentCollection.Contains(...)
的東西,除非比較該物品的屬性是否已經在集合中?如果集合尚未包含項目的屬性,則將項目添加到集合中?
public class Foo
{
public Int32 bar;
}
ICollection<Foo> CurrentCollection;
ICollection<Foo> DownloadedItems;
//LINQ: Add any downloaded items where the bar Foo.bar is not already in the collection?