Exemplo n.º 1
0
        public static ByteLookup <TElement> Create <TSource>(IEnumerable <TSource> source, Func <TSource, byte> keySelector, Func <TSource, TElement> elementSelector)
        {
            var result = new ByteLookup <TElement>();

            foreach (var source1 in source)
            {
                result.GetGrouping(keySelector(source1)).Add(elementSelector(source1));
                result.Count++;
            }

            return(result);
        }
 public IEnumerator <IGrouping <byte, TElement> > GetEnumerator()
 {
     return(ByteLookup <TElement>
            .Create(this.source, this.keySelector, this.elementSelector)
            .GetEnumerator());
 }