Example #1
0
 public ReadOnlyIndexedHashSet(IIndexedHashSet <T> hashSet)
 {
     if (hashSet == null)
     {
         throw new ArgumentNullException("hashSet");
     }
     this.hashSet = hashSet;
 }
Example #2
0
        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()));
        }