5 implementations of IGrouping
Microsoft.CodeAnalysis (1)
Microsoft.Data.Analysis (1)
System.Linq (1)
System.Linq.Parallel (2)
262 references to IGrouping
AnalyzerRunner (1)
Aspire.Dashboard.Components.Tests (1)
Aspire.Hosting (1)
CodeGenerator (1)
IdeCoreBenchmarks (1)
installer.tasks (1)
IOperationGenerator (1)
Microsoft.AspNetCore.App.Analyzers (2)
Microsoft.AspNetCore.Mvc.Core (2)
Microsoft.AspNetCore.Mvc.Razor (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
Microsoft.AspNetCore.OpenApi (2)
Microsoft.AspNetCore.Routing (6)
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
Microsoft.AspNetCore.Routing.Tests (2)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Microsoft.Build.Tasks.CodeAnalysis (1)
Microsoft.Build.Tasks.Core (2)
Microsoft.Cci.Extensions (1)
Microsoft.CodeAnalysis (23)
MetadataReader\MetadataHelpers.cs (11)
769IEnumerable<IGrouping<string, TypeDefinitionHandle>> typesByNS,
771out IEnumerable<IGrouping<string, TypeDefinitionHandle>> types,
772out IEnumerable<KeyValuePair<string, IEnumerable<IGrouping<string, TypeDefinitionHandle>>>> namespaces)
779var nestedTypes = new List<IGrouping<string, TypeDefinitionHandle>>();
786var nestedNamespaces = new List<KeyValuePair<string, IEnumerable<IGrouping<string, TypeDefinitionHandle>>>>();
795var pair = enumerator.Current;
802List<IGrouping<string, TypeDefinitionHandle>> typesInLastChildNamespace = null;
852new KeyValuePair<string, IEnumerable<IGrouping<string, TypeDefinitionHandle>>>(
856typesInLastChildNamespace = new List<IGrouping<string, TypeDefinitionHandle>>();
870new KeyValuePair<string, IEnumerable<IGrouping<string, TypeDefinitionHandle>>>(
903nestedNamespaces[i] = default(KeyValuePair<string, IEnumerable<IGrouping<string, TypeDefinitionHandle>>>);
Microsoft.CodeAnalysis.CodeStyle (5)
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
Microsoft.CodeAnalysis.CSharp (11)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features (3)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.Features (16)
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Microsoft.CodeAnalysis.UnitTests (8)
MetadataReferences\MetadataHelpersTests.cs (8)
426var result = new ArrayBuilder<IGrouping<string, TypeDefinitionHandle>>();
436IEnumerable<IGrouping<string, TypeDefinitionHandle>> typesByNS = result;
440IEnumerable<IGrouping<string, TypeDefinitionHandle>> nestedTypes = null;
441IEnumerable<KeyValuePair<string, IEnumerable<IGrouping<string, TypeDefinitionHandle>>>> nestedNamespaces = null;
466var result = new ArrayBuilder<IGrouping<string, TypeDefinitionHandle>>();
476IEnumerable<IGrouping<string, TypeDefinitionHandle>> typesByNS = result;
480IEnumerable<IGrouping<string, TypeDefinitionHandle>> nestedTypes = null;
481IEnumerable<KeyValuePair<string, IEnumerable<IGrouping<string, TypeDefinitionHandle>>>> nestedNamespaces = null;
Microsoft.CodeAnalysis.Workspaces (14)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.CommonLanguageServerProtocol.Framework.Package (2)
Microsoft.Data.Analysis (1)
Microsoft.Data.Analysis.Tests (2)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.DotNet.Build.Tasks.Packaging (6)
Microsoft.DotNet.SignTool (1)
Microsoft.Extensions.DependencyModel (3)
Microsoft.Extensions.Logging.AzureAppServices (2)
Microsoft.Extensions.Logging.Generators (1)
Microsoft.Extensions.Options.SourceGeneration (1)
Microsoft.Gen.ComplianceReports (2)
Microsoft.Gen.ContextualOptions (2)
Microsoft.Gen.Logging (1)
Microsoft.Gen.Metrics (1)
Microsoft.Gen.MetricsReports (1)
Microsoft.Interop.ComInterfaceGenerator (1)
Microsoft.ML.AutoML (2)
Microsoft.ML.Fairlearn (1)
Microsoft.VisualStudio.LanguageServices (1)
netstandard (1)
PrepareTests (2)
System.Core (1)
System.Linq (36)
System\Linq\Grouping.cs (8)
12public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) =>
15public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
35public static IEnumerable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) =>
38public static IEnumerable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer)
238private sealed partial class GroupByIterator<TSource, TKey, TElement> : Iterator<IGrouping<TKey, TElement>>
256private protected override Iterator<IGrouping<TKey, TElement>> Clone() => new GroupByIterator<TSource, TKey, TElement>(_source, _keySelector, _elementSelector, _comparer);
293private sealed partial class GroupByIterator<TSource, TKey> : Iterator<IGrouping<TKey, TSource>>
309private protected override Iterator<IGrouping<TKey, TSource>> Clone() => new GroupByIterator<TSource, TKey>(_source, _keySelector, _comparer);
System\Linq\Lookup.cs (22)
64public interface ILookup<TKey, TElement> : IEnumerable<IGrouping<TKey, TElement>>
138public IEnumerator<IGrouping<TKey, TElement>> GetEnumerator()
262internal sealed class CollectionLookup<TKey, TElement> : Lookup<TKey, TElement>, ICollection<IGrouping<TKey, TElement>>, IReadOnlyCollection<IGrouping<TKey, TElement>>
266void ICollection<IGrouping<TKey, TElement>>.CopyTo(IGrouping<TKey, TElement>[] array, int arrayIndex)
288bool ICollection<IGrouping<TKey, TElement>>.Contains(IGrouping<TKey, TElement> item)
294bool ICollection<IGrouping<TKey, TElement>>.IsReadOnly => true;
295void ICollection<IGrouping<TKey, TElement>>.Add(IGrouping<TKey, TElement> item) => throw new NotSupportedException();
296void ICollection<IGrouping<TKey, TElement>>.Clear() => throw new NotSupportedException();
297bool ICollection<IGrouping<TKey, TElement>>.Remove(IGrouping<TKey, TElement> item) => throw new NotSupportedException();
302internal sealed class EmptyLookup<TKey, TElement> : ILookup<TKey, TElement>, ICollection<IGrouping<TKey, TElement>>, IReadOnlyCollection<IGrouping<TKey, TElement>>
309public IEnumerator<IGrouping<TKey, TElement>> GetEnumerator() => Enumerable.Empty<IGrouping<TKey, TElement>>().GetEnumerator();
313public bool Contains(IGrouping<TKey, TElement> item) => false;
314public void CopyTo(IGrouping<TKey, TElement>[] array, int arrayIndex)
322public void Add(IGrouping<TKey, TElement> item) => throw new NotSupportedException();
324public bool Remove(IGrouping<TKey, TElement> item) => throw new NotSupportedException();
System.Linq.Parallel (49)
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (19)
30UnaryQueryOperator<TSource, IGrouping<TGroupKey, TElement>>
69PartitionedStream<TSource, TKey> inputStream, IPartitionedStreamRecipient<IGrouping<TGroupKey, TElement>> recipient,
100IPartitionedStreamRecipient<IGrouping<TGroupKey, TElement>> recipient,
104PartitionedStream<IGrouping<TGroupKey, TElement>, TKey> outputStream =
105new PartitionedStream<IGrouping<TGroupKey, TElement>, TKey>(partitionCount, hashStream.KeyComparer, OrdinalIndexState.Shuffled);
119outputStream[i] = (QueryOperatorEnumerator<IGrouping<TGroupKey, TElement>, TKey>)(object)enumerator;
138IPartitionedStreamRecipient<IGrouping<TGroupKey, TElement>> recipient,
142PartitionedStream<IGrouping<TGroupKey, TElement>, TKey> outputStream =
143new PartitionedStream<IGrouping<TGroupKey, TElement>, TKey>(partitionCount, hashStream.KeyComparer, OrdinalIndexState.Shuffled);
158outputStream[i] = (QueryOperatorEnumerator<IGrouping<TGroupKey, TElement>, TKey>)(object)enumerator;
174internal override QueryResults<IGrouping<TGroupKey, TElement>> Open(QuerySettings settings, bool preferStriping)
187internal override IEnumerable<IGrouping<TGroupKey, TElement>> AsSequentialQuery(CancellationToken token)
193return (IEnumerable<IGrouping<TGroupKey, TElement>>)wrappedChild.GroupBy(_keySelector, _keyComparer);
222QueryOperatorEnumerator<IGrouping<TGroupKey, TElement>, TOrderKey>
256internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref IGrouping<TGroupKey, TElement> currentElement, [AllowNull] ref TOrderKey currentKey)
423QueryOperatorEnumerator<IGrouping<TGroupKey, TElement>, TOrderKey>
462internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref IGrouping<TGroupKey, TElement> currentElement, [AllowNull] ref TOrderKey currentKey)
697TGroupKey IGrouping<TGroupKey, TElement>.Key
749TGroupKey IGrouping<TGroupKey, TElement>.Key
System\Linq\Parallel\Utils\Lookup.cs (8)
39private readonly Dictionary<TKey, IGrouping<TKey, TElement>> _dict;
41private IGrouping<TKey, TElement>? _defaultKeyGrouping;
46_dict = new Dictionary<TKey, IGrouping<TKey, TElement>>(_comparer);
79IGrouping<TKey, TElement>? grouping;
111internal void Add(IGrouping<TKey, TElement> grouping)
127public IEnumerator<IGrouping<TKey, TElement>> GetEnumerator()
132foreach (IGrouping<TKey, TElement> grouping in _dict.Values)
145return ((IEnumerable<IGrouping<TKey, TElement>>)this).GetEnumerator();
System\Linq\ParallelEnumerable.cs (22)
1296public static ParallelQuery<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(
1315public static ParallelQuery<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(
1342public static ParallelQuery<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(
1368public static ParallelQuery<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(
1414.Select<IGrouping<TKey, TSource>, TResult>(delegate (IGrouping<TKey, TSource> grouping) { return resultSelector(grouping.Key, grouping); });
1440return source.GroupBy<TSource, TKey>(keySelector, comparer).Select<IGrouping<TKey, TSource>, TResult>(
1441delegate (IGrouping<TKey, TSource> grouping) { return resultSelector(grouping.Key, grouping); });
1471.Select<IGrouping<TKey, TElement>, TResult>(delegate (IGrouping<TKey, TElement> grouping) { return resultSelector(grouping.Key, grouping); });
1502.Select<IGrouping<TKey, TElement>, TResult>(delegate (IGrouping<TKey, TElement> grouping) { return resultSelector(grouping.Key, grouping); });
5146ParallelQuery<IGrouping<TKey, TSource>> groupings = source.GroupBy(keySelector, comparer);
5150Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TSource>>);
5151QueryOperator<IGrouping<TKey, TSource>>? op = groupings as QueryOperator<IGrouping<TKey, TSource>>;
5153IEnumerator<IGrouping<TKey, TSource>> input = (op == null) ? groupings.GetEnumerator() : op.GetEnumerator(ParallelMergeOptions.FullyBuffered);
5233ParallelQuery<IGrouping<TKey, TElement>> groupings = source.GroupBy(keySelector, elementSelector, comparer);
5237Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TElement>>);
5238QueryOperator<IGrouping<TKey, TElement>>? op = groupings as QueryOperator<IGrouping<TKey, TElement>>;
5240IEnumerator<IGrouping<TKey, TElement>> input = (op == null) ? groupings.GetEnumerator() : op.GetEnumerator(ParallelMergeOptions.FullyBuffered);
System.Linq.Queryable (14)
System\Linq\Queryable.cs (12)
590public static IQueryable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
595return source.Provider.CreateQuery<IGrouping<TKey, TSource>>(
598new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IQueryable<IGrouping<TKey, TSource>>>(GroupBy).Method,
603public static IQueryable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
609return source.Provider.CreateQuery<IGrouping<TKey, TElement>>(
612new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, IQueryable<IGrouping<TKey, TElement>>>(GroupBy).Method,
617public static IQueryable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
622return source.Provider.CreateQuery<IGrouping<TKey, TSource>>(
625new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<IGrouping<TKey, TSource>>>(GroupBy).Method,
630public static IQueryable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey>? comparer)
636return source.Provider.CreateQuery<IGrouping<TKey, TElement>>(
639new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, IEqualityComparer<TKey>, IQueryable<IGrouping<TKey, TElement>>>(GroupBy).Method,
xunit.console (1)