public void MethodName(ObservableCollection<DataCollection> dataCollection)
{
if (dataCollection != null)
{
IsChecked = dataCollection.Any(o => o.DataCollectionID.Equals(30));
IsChecked = dataCollection.Where(o => o.DataCollectionID.Equals(30)).Count() > 0;
}
}
Can anyone explain me, what could be the most efficient way to use from above two filtering? .Any? or .Where.Count?
Note: Consider that dataCollection has over 10,000 items.
Please advice me. Thank you