public ReadOnlyIndexedHashSet(IIndexedHashSet <T> hashSet) { if (hashSet == null) { throw new ArgumentNullException("hashSet"); } this.hashSet = hashSet; }
public static TDocumentItem FindMatchByUrl <TDocumentItem>(this IEnumerable <TDocumentItem> source, string url) where TDocumentItem : class, IDocumentItem { DocumentReference documentReference = DocumentReference.Create(url); IIndexedHashSet <TDocumentItem> tDocumentItems = source as IIndexedHashSet <TDocumentItem>; if (tDocumentItems != null) { return(tDocumentItems[documentReference.GetHashCode()]); } return(source.FirstOrDefault <TDocumentItem>((TDocumentItem d) => d.DocumentReference.GetHashCode() == documentReference.GetHashCode())); }