264 references to ToDictionary
aspire (5)
Backchannel\ExtensionBackchannel.cs (2)
418var choicesByFormattedValue = choicesList.ToDictionary(choice => choiceFormatter(choice).RemoveSpectreFormatting(), choice => choice); 448var choicesByFormattedValue = choicesList.ToDictionary(choice => choiceFormatter(choice).RemoveSpectreFormatting(), choice => choice);
Commands\TelemetryTracesCommand.cs (1)
366.ToDictionary(g => g.Key, g => g.OrderBy(s => s.StartNano).ToList());
DotNet\DotNetCliExecution.cs (1)
35_process.StartInfo.Environment.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Projects\ProjectUpdater.cs (1)
1041var mappingChangesBySource = changes.MappingChanges.ToDictionary(mc => mc.SourceKey, mc => mc);
Aspire.Cli.Tests (9)
Mcp\ExecuteResourceCommandToolTests.cs (2)
24.ToDictionary(p => p.Name, p => p.Value.Clone()); 148.EnumerateObject().ToDictionary(p => p.Name, p => p.Value.Clone());
Telemetry\AspireCliTelemetryTests.cs (3)
39var activityTags = activity.Tags.ToDictionary(t => t.Key, t => t.Value); 100var eventTags = exceptionEvent.Tags.ToDictionary(t => t.Key, t => t.Value); 231var activityTags = activity.Tags.ToDictionary(t => t.Key, t => t.Value);
TestServices\TestDotNetCliExecutionFactory.cs (1)
88EnvironmentVariables = env?.ToDictionary(kvp => kvp.Key, kvp => (string?)kvp.Value)
Utils\SdkInstallHelperTests.cs (3)
33var tags = fixture.CapturedActivity.Tags.ToDictionary(t => t.Key, t => t.Value); 59var tags = fixture.CapturedActivity.Tags.ToDictionary(t => t.Key, t => t.Value); 85var tags = fixture.CapturedActivity.Tags.ToDictionary(t => t.Key, t => t.Value);
Aspire.Dashboard (3)
Components\Controls\Chart\MetricTable.razor.cs (1)
132var traceValuesByPercentile = traces.ToDictionary(trace => trace.Percentile!.Value, trace => trace.Values[iTmp]);
Model\Otlp\SpanWaterfallViewModel.cs (1)
131var groupedLogs = logs.GroupBy(l => l.SpanId).ToDictionary(l => l.Key, g => g.ToList());
Otlp\Model\OtlpResource.cs (1)
281.ToDictionary(grouping => grouping.Key, grouping => grouping.ToList());
Aspire.Dashboard.Tests (1)
Model\TelemetryExportServiceTests.cs (1)
1106return allResources.ToDictionary(
Aspire.Hosting (5)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
937JsonValueKind.Object => element.EnumerateObject().ToDictionary(p => p.Name, p => ConvertJsonElementToObject(p.Value)),
Health\ResourceHealthCheckService.cs (1)
168report = new HealthReport(registrationKeysToCheck.ToDictionary(k => k, k => new HealthReportEntry(HealthStatus.Unhealthy, "Error calling HealthCheckService.", TimeSpan.Zero, ex, data: null)), TimeSpan.Zero);
Orchestrator\RelationshipEvaluator.cs (1)
61var childToParentLookup = relationships.ToDictionary(x => x.Child, x => x.Parent);
Pipelines\DistributedApplicationPipeline.cs (1)
1038.ToDictionary(g => g.Key, g => g.Select(kvp => kvp.Key).OrderBy(s => s, StringComparer.Ordinal).ToList());
UserSecrets\UserSecretsManagerFactory.cs (1)
175.ToDictionary(i => i.Key, i => i.Value);
Aspire.Hosting.Azure.Kusto.Tests (2)
AzureKustoConnectionPropertiesTests.cs (2)
53var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 77var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
179public IReadOnlyDictionary<string, string> Databases => _databases.ToDictionary(
Aspire.Hosting.Azure.Tests (28)
AzureBlobStorageConnectionPropertiesTests.cs (1)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureBlobStorageContainerConnectionPropertiesTests.cs (1)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureCosmosDBContainerConnectionPropertiesTests.cs (2)
20var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 50var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureCosmosDBDatabaseConnectionPropertiesTests.cs (2)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 43var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureDataLakeStorageFileSystemConnectionPropertiesTests.cs (1)
20.ToDictionary(x => x.Key, x => x.Value);
AzureEventHubConnectionPropertiesTests.cs (1)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureEventHubConsumerGroupConnectionPropertiesTests.cs (1)
20var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureOpenAIConnectionPropertiesTests.cs (1)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureOpenAIDeploymentConnectionPropertiesTests.cs (1)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzurePostgresFlexibleServerConnectionPropertiesTests.cs (2)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 51var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzurePostgresFlexibleServerDatabaseConnectionPropertiesTests.cs (2)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 58var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureQueueStorageConnectionPropertiesTests.cs (1)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureQueueStorageQueueConnectionPropertiesTests.cs (1)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureSearchConnectionPropertiesTests.cs (1)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureServiceBusQueueConnectionPropertiesTests.cs (1)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureServiceBusSubscriptionConnectionPropertiesTests.cs (1)
20var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureServiceBusTopicConnectionPropertiesTests.cs (1)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureSqlConnectionPropertiesTests.cs (1)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureSqlDatabaseConnectionPropertiesTests.cs (4)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 52var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 97var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 148var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureTableStorageConnectionPropertiesTests.cs (1)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
AzureWebPubSubConnectionPropertiesTests.cs (1)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value);
Aspire.Hosting.Tests (2)
Pipelines\DistributedApplicationPipelineTests.cs (1)
256var stepTimes = executionOrder.ToDictionary(x => x.step, x => x.time);
SecretsStoreTests.cs (1)
91.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
CSharpSyntaxGenerator (3)
AbstractFileWriter.cs (1)
35_parentMap = tree.Types.ToDictionary(n => n.Name, n => n.Base);
Grammar\GrammarGenerator.cs (1)
24var rules = types.ToDictionary(n => n.Name, _ => new List<Production>());
SignatureWriter.cs (1)
24_typeMap = tree.Types.ToDictionary(n => n.Name, n => n.Base);
dotnet (6)
Commands\Tool\Restore\ToolRestoreCommand.cs (1)
120.ToDictionary(pair => pair.Value.restoredCommandIdentifier, pair => pair.Value.toolCommand);
Commands\Workload\Install\WorkloadGarbageCollector.cs (1)
81_workloadSets = installedWorkloadSets.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.IsBaselineWorkloadSet ? GCAction.KeepWithoutPacks : GCAction.Collect);
Commands\Workload\Install\WorkloadManifestUpdater.cs (1)
255recorder.HistoryRecord.RollbackFileContents = manifestRollbacks.ToDictionary(kvp => kvp.Id.ToString(), kvp => kvp.ManifestWithBand.Version + "/" + kvp.ManifestWithBand.Band);
Commands\Workload\Search\WorkloadSearchVersionsCommand.cs (1)
125Reporter.WriteLine(JsonSerializer.Serialize(versions.Select(version => version.ToDictionary(_ => "workloadVersion", v => v)), WorkloadSearchVersionsJsonSerializerContext.Default.IEnumerableDictionaryStringString));
Commands\Workload\WorkloadHistoryRecorder.cs (1)
64ManifestVersions = resolver.GetInstalledManifests().ToDictionary(manifest => manifest.Id.ToString(), manifest => $"{manifest.Version}/{manifest.ManifestFeatureBand}"),
ToolPackage\ToolConfigurationDeserializer.cs (1)
91var ridSpecificPackages = dotNetCliTool.RuntimeIdentifierPackages?.ToDictionary(p => p.RuntimeIdentifier, p => new PackageIdentity(p.Id, null))
dotnet-watch (1)
CommandLine\CommandLineOptions.cs (1)
338var knownCommandsByName = dotnetDefinition.Subcommands.ToDictionary(keySelector: c => c.Name, elementSelector: c => c);
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
54var itemToItemsBefore = items.ToDictionary(item => item, item =>
ILCompiler.ReadyToRun (2)
Compiler\ProfileDataManager.cs (2)
478_delegateTargets = delegateTargets.ToDictionary(kvp => kvp.Key, kvp => 485_implementers = implementers.ToDictionary(kvp => kvp.Key, kvp =>
Microsoft.AspNetCore.Components (1)
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternFactory.cs (1)
537? parameterPolicyReferences.ToDictionary(kvp => kvp.Key, kvp => (IReadOnlyList<RoutePatternParameterPolicyReference>)kvp.Value.ToArray())
Microsoft.AspNetCore.Components.Endpoints (4)
Assets\ImportMapDefinition.cs (4)
40_imports = imports?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 41_integrity = integrity?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 42_scopes = scopes?.ToDictionary( 44kvp => kvp.Value.ToDictionary(scopeKvp => scopeKvp.Key, scopeKvp => scopeKvp.Value) as IReadOnlyDictionary<string, string>);
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiResponseTypeProvider.cs (1)
123.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Microsoft.AspNetCore.OutputCaching (1)
Memory\MemoryOutputCacheStore.cs (1)
24internal Dictionary<string, HashSet<string>> TaggedEntries => _taggedEntries.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Select(t => t.Key).ToHashSet());
Microsoft.AspNetCore.Routing (1)
Patterns\RoutePatternFactory.cs (1)
537? parameterPolicyReferences.ToDictionary(kvp => kvp.Key, kvp => (IReadOnlyList<RoutePatternParameterPolicyReference>)kvp.Value.ToArray())
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\ConfigSectionClone.cs (1)
19Children = children.ToDictionary(child => child.Key, child => new ConfigSectionClone(child));
Microsoft.Build (7)
BackEnd\BuildManager\RequestedProjectState.cs (1)
51result.ItemFilters = ItemFilters.ToDictionary(
Evaluation\Evaluator.cs (1)
862var pluginSettings = item.Metadata.ToDictionary(m => m.Key, m => m.EscapedValue);
Graph\ProjectGraph.cs (2)
565var inDegree = graphNodes.ToDictionary(n => n, n => n.ReferencingProjects.Count); 614var targetLists = ProjectNodes.ToDictionary(node => node, node => ImmutableList<string>.Empty);
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1263var e = new BuildCheckTracingEventArgs(rawTracingData.ToDictionary(
Logging\ParallelLogger\ParallelConsoleLogger.cs (1)
241WriteEnvironment(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
Logging\ProfilerLogger.cs (1)
221var idTable = aggregatedLocations.ToDictionary(pair => pair.Key.Id,
Microsoft.Build.Framework (1)
BuildCheck\BuildCheckTracingData.cs (1)
42.ToDictionary(g => g.Key, g => g.First().Value.TotalRuntime);
Microsoft.Build.Tasks.Core (1)
SystemState.cs (1)
647instanceLocalOutgoingFileStateCache = instanceLocalFileStateCache.ToDictionary(kvp => FileUtilities.MakeRelative(Path.GetDirectoryName(stateFile), kvp.Key), kvp => kvp.Value);
Microsoft.Build.Utilities.Core (1)
MuxLogger.cs (1)
865Traits.LogAllEnvironmentVariables ? _buildStartedEvent.BuildEnvironment : _buildStartedEvent.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
Microsoft.CodeAnalysis.Analyzers (2)
MetaAnalyzers\SymbolIsBannedInAnalyzersAnalyzer.cs (1)
116return result.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableArray());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
54var itemToItemsBefore = items.ToDictionary(item => item, item =>
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
54var itemToItemsBefore = items.ToDictionary(item => item, item =>
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
54var itemToItemsBefore = items.ToDictionary(item => item, item =>
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
475var mapping = capturedMethodTypeParameters.ToDictionary(tp => tp,
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
23return dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.AsImmutable());
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
222var namespaceDeclarationMap = namespaceDeclarations.ToDictionary( 258var namespaceDeclarationMap = namespaceDeclarations.ToDictionary(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
259.ToDictionary(p => p.parameter, p => p.renamed);
Microsoft.CodeAnalysis.CSharp.Features (3)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
222var namespaceDeclarationMap = namespaceDeclarations.ToDictionary( 258var namespaceDeclarationMap = namespaceDeclarations.ToDictionary(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
259.ToDictionary(p => p.parameter, p => p.renamed);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
23return dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.AsImmutable());
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Api\HotReloadMSBuildWorkspace.cs (1)
76var oldProjectIdsByPath = oldSolution.Projects.ToDictionary(keySelector: static p => (p.FilePath!, p.Name), elementSelector: static p => p.Id);
Microsoft.CodeAnalysis.Features (9)
CodeFixes\Service\CodeFixService.cs (1)
1038_fixerToIndex = allFixers.Select((fixer, index) => (fixer, index)).ToDictionary(t => t.fixer, t => t.index);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
1653map.ToDictionary(keySelector: entry => entry.Value, elementSelector: entry => entry.Key),
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
41.ToDictionary(location => location, _ => new SyntaxAnnotation());
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (2)
108.ToDictionary( 133.ToDictionary(
ExtractMethod\SelectionResult.cs (2)
245var tokenMap = pairs.GroupBy(p => p.Item1, p => p.Item2).ToDictionary(g => g.Key, g => g.ToArray()); 258var tokenMap = pairs.GroupBy(p => p.Item1, p => p.Item2).ToDictionary(g => g.Key, g => g.ToArray());
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
475var mapping = capturedMethodTypeParameters.ToDictionary(tp => tp,
UnusedReferences\UnusedReferencesRemover.cs (1)
71.ToDictionary(group => group.Key, group => group.ToImmutableArray());
Microsoft.CodeAnalysis.Razor.Compiler (2)
Language\Components\ComponentGenericTypePass.cs (2)
104var mappings = bindings.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Node); 251var mappings = bindings.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Node);
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
54var itemToItemsBefore = items.ToDictionary(item => item, item =>
Microsoft.CodeAnalysis.Workspaces (2)
CodeCleanup\AbstractCodeCleanerService.cs (1)
595var tokenMap = map.ToDictionary(p => p.Key, p => p.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
54var itemToItemsBefore = items.ToDictionary(item => item, item =>
Microsoft.Data.Analysis (1)
DataFrame.Join.cs (1)
235newOccurrences = newOccurrences.ToDictionary(kvp => retainedIndicesReverseMapping[kvp.Key], kvp => kvp.Value);
Microsoft.Data.Analysis.Tests (1)
DataFrameGroupByTests.cs (1)
71var groupings = df.GroupBy<int>("Tens").Groupings.ToDictionary(g => g.Key, g => g.ToList());
Microsoft.Diagnostics.DataContractReader.Legacy (2)
SOSDacImpl.cs (2)
4857Dictionary<ulong, uint> expectedElements = elements.ToDictionary(tuple => tuple.Address.ToClrDataAddress(_target).Value, tuple => tuple.Index); 4916Dictionary<ulong, ulong> expectedElements = cleanupInfos.ToDictionary(info => info.RCW.ToClrDataAddress(_target).Value, info => info.Context.ToClrDataAddress(_target).Value);
Microsoft.DotNet.Build.Manifest (1)
XElementParsingExtensions.cs (1)
26return element.Attributes().ToDictionary(a => a.Name.LocalName, a => a.Value);
Microsoft.DotNet.Build.Tasks.Installers (1)
src\CreateRpmPackage.cs (1)
119Dictionary<string, string> filePathToKind = RawPayloadFileKinds.Select(k => k.ItemSpec.Split(':')).ToDictionary(k => k[0], k => k[1].Trim());
Microsoft.DotNet.Build.Tasks.Packaging (4)
NuGetPack.cs (1)
286Dictionary<string, bool> pathHasMatches = EffectiveLibPackageExcludes.ToDictionary(
PromoteDependencies.cs (2)
44var refSets = dependencies.Where(d => d.Id != "_._").Where(d => d.IsReference).GroupBy(d => NuGetFramework.Parse(d.TargetFramework)).ToDictionary(g => g.Key, g => g.ToArray()); 49var libSets = dependencies.Where(d => !d.IsReference).GroupBy(d => NuGetFramework.Parse(d.TargetFramework)).ToDictionary(g => g.Key, g => g.ToArray());
ValidateFrameworkPackage.cs (1)
42.ToDictionary(a => Path.GetFileNameWithoutExtension(a.PackagePath), a => a);
Microsoft.DotNet.Cli.Utils (1)
TelemetryEventEntry.cs (1)
75var appliedProperties = Properties?.ToDictionary(p => p.Key, p => (string?)func(p.Value ?? string.Empty));
Microsoft.DotNet.HotReload.Watch (2)
Build\EvaluationResult.cs (1)
98var restoredProjectInstances = projectGraph.Graph.ProjectNodes.ToDictionary(
Build\LoadedProjectGraph.cs (1)
15graph.ProjectNodes.Where(n => n.ProjectInstance.GetTargetFramework() != "").GroupBy(n => n.ProjectInstance.FullPath).ToDictionary(
Microsoft.DotNet.SharedFramework.Sdk (1)
src\GeneratePlatformManifestEntriesFromTemplate.cs (1)
32var files = Files.ToLookup(file => Path.GetFileName(file.ItemSpec)).ToDictionary(l => l.Key, l=> l.First());
Microsoft.DotNet.TemplateLocator (2)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (2)
25ManifestVersions = manifests.ToDictionary(m => new ManifestId(m.Id), m => (new ManifestVersion(m.Version), new SdkFeatureBand(m.ManifestFeatureBand))) 58}).ToDictionary(t => t.id, t => (t.manifestVersion, t.manifestFeatureBand));
Microsoft.DotNet.XliffTasks (1)
Tasks\TransformTemplates.cs (1)
93Dictionary<string, string> defaultTranslation = document.Nodes.ToDictionary(node => node.Id, node => node.Source);
Microsoft.Extensions.AI.Abstractions.Tests (5)
Contents\FunctionCallContentTests.cs (4)
247""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value); 268""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value); 287""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value)); 323""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value));
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
1172private readonly IReadOnlyDictionary<TKey, TValue> _dictionary = values.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Microsoft.Extensions.AI.Integration.Tests (1)
VerbatimMultiPartHttpHandler.cs (1)
194.ToDictionary(g => g.Key, g => g.Count());
Microsoft.Extensions.AI.Tests (3)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
192var tags = activity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Image\OpenTelemetryImageGeneratorTests.cs (1)
115var tags = activity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
SpeechToText\OpenTelemetrySpeechToTextClientTests.cs (1)
126var tags = activity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Microsoft.Extensions.Diagnostics.Testing.Tests (2)
Logging\FakeLoggerTests.cs (2)
86var ss = logger.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 102ss = logger.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value);
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\Internal\LogRecordExtensions.cs (1)
19return logRecord.StructuredState.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Microsoft.Extensions.Http.Resilience.Tests (1)
Helpers\OptionsUtilities.cs (1)
55.ToDictionary(
Microsoft.Extensions.Resilience.Tests (1)
Resilience\ResilienceMetricsEnricherTests.cs (1)
26private IReadOnlyDictionary<string, object?> Tags => _tags.ToDictionary(v => v.Key, v => v.Value);
Microsoft.Gen.Logging.Generated.Tests (4)
LogPropertiesTests.cs (4)
45var ss = _logger.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 176var ss = collector.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 194ss = collector.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 604.ToDictionary(p => p.Key, p => p.Value);
Microsoft.Interop.ComInterfaceGenerator (1)
ComMethodContext.cs (1)
122var ifaceToDeclaredMethodsMap = ifaceAndDeclaredMethods.ToDictionary(static pair => pair.Item1, static pair => pair.Item2);
Microsoft.Maui (1)
Handlers\HybridWebView\HybridWebViewQueryStringHelper.cs (1)
42 .ToDictionary(p => p[0], p => Uri.UnescapeDataString(p[1]));
Microsoft.ML.AutoML (16)
SweepableEstimator\MultiModelPipeline.cs (1)
114var estimators = _estimators.ToDictionary(x => x.Key, x => x.Value);
SweepableEstimator\SweepablePipeline.cs (2)
112.ToDictionary((se) => se.ToString(), (se) => _estimators[((StringEntity)se).Value]); 174var estimators = _estimators.ToDictionary(x => x.Key, x => x.Value);
TrainerExtensions\TrainerExtensionCatalog.cs (1)
50_trainerNamesToExtensionTypes.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
TrainerExtensions\TrainerExtensionUtil.cs (4)
173var boosterProps = boosterParams.ToDictionary(p => p.Name, p => (object)p.ProcessedValue()); 176props = parentArgParams.ToDictionary(p => p.Name, p => (object)p.ProcessedValue()); 196.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 283.ToDictionary(v => Enum.GetName(fi.FieldType, v), v => v);
Tuner\AutoZeroTuner.cs (1)
35}).ToDictionary(kv => kv.schema, kv => kv.pipelineString);
Tuner\EciCfoTuner.cs (1)
32_tuners = pipelineSchemas.ToDictionary(schema => schema, schema =>
Tuner\PipelineProposer.cs (6)
87_learnerInitialCost = _pipelineSchemas.ToDictionary(kv => kv, kv => GetEstimatedCostForPipeline(kv, _sweepablePipeline)); 89_eci = _pipelineSchemas.ToDictionary(kv => kv, kv => GetEstimatedCostForPipeline(kv, _sweepablePipeline)); 151_k1 = _pipelineSchemas.ToDictionary(id => id, id => duration * _learnerInitialCost[id] / _learnerInitialCost[schema]); 152_k2 = _k1.ToDictionary(kv => kv.Key, kv => kv.Value); 153_e1 = _pipelineSchemas.ToDictionary(id => id, id => loss); 154_e2 = _pipelineSchemas.ToDictionary(id => id, id => loss + 0.05 * Math.Abs(loss));
Microsoft.ML.AutoML.Tests (1)
Utils\TaskAgnosticIterationResult.cs (1)
83return propertiesToReport.ToDictionary(p => p.Name, p => (double)metric.GetType().GetProperty(p.Name).GetValue(metric));
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
82return sampleData.Cast<DictionaryEntry>().ToDictionary(k => (string)k.Key, v => (string)v.Value);
Microsoft.ML.Data (1)
DataView\InternalSchemaDefinition.cs (1)
77: metadataInfos.ToDictionary(entry => entry.Key, entry => entry.Value);
Microsoft.ML.Fairlearn (2)
Metrics\FairlearnMetricCatalog.cs (2)
94.ToDictionary(group => group.Key, group => _context.Data.LoadFromEnumerable(group.Select(g => g.Item2))); 97.ToDictionary(kv => kv.Key, kv => kv.Item2);
Microsoft.ML.GenAI.Core (2)
Extension\ModuleExtension.cs (2)
152var childrenDeviceMap = deviceMap.Where(x => x.Key.StartsWith($"{key}.")).ToDictionary(x => x.Key.Substring($"{key}.".Length), x => x.Value); 180var remainingLayerSizeMap = layerSizeMap.Where(x => !deviceMap.ContainsKey(x.Key)).ToDictionary(x => x.Key, x => x.Value);
Microsoft.ML.GenAI.Phi.Tests (1)
Phi3Tests.cs (1)
107var sizeInMB = size.ToDictionary(x => x.Key, x => x.Value / 1024 / 1024);
Microsoft.ML.Predictor.Tests (2)
CompareBaselines.cs (2)
70.ToDictionary(s => Path.GetFileName(s).ToLowerInvariant(), s => false); 93.ToDictionary(s => Path.GetFileName(s).ToLowerInvariant(), s => false);
Microsoft.ML.ResultProcessor (2)
ResultProcessor.cs (2)
174.ToDictionary(g => "/" + g.Key, g => string.Join(",", g)); 537GroupBy(kvp => kvp.Key, kvp => kvp.Value).ToDictionary(g => "/" + g.Key, g => string.Join(",", g));
Microsoft.ML.SearchSpace (3)
SearchSpace.cs (3)
39_options = options.ToDictionary(kv => kv.Key, kv => kv.Value); 45_options = options.ToDictionary(kv => kv.Key, kv => kv.Value); 176return fieldOptions.Concat(propertyOptions).ToDictionary(kv => kv.Key, kv => kv.Value);
Microsoft.ML.TimeSeries (1)
RootCauseAnalyzer.cs (1)
130return new Dictionary<string, object>(keyList.Select(dim => new KeyValuePair<string, object>(dim, dimension[dim])).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
Microsoft.ML.Tokenizers (11)
Model\BPETokenizer.cs (3)
355_specialTokens = specialTokens.ToDictionary(kvp => new StringSpanOrdinalKey(kvp.Key), kvp => (kvp.Value, kvp.Key)); 356_specialTokensReverse = specialTokens.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 766public IReadOnlyDictionary<string, int> Vocabulary => _vocabOriginal ??= new ReadOnlyDictionary<string, int>(_vocab.ToDictionary(kvp => kvp.Key.Data!, kvp => kvp.Value));
Model\CodeGenTokenizer.cs (4)
128_vocabReverse = _vocab.ToDictionary(kvp => kvp.Value.Id, kvp => kvp.Value.Token); 137_specialTokens = specialTokens.ToDictionary(kvp => new StringSpanOrdinalKey(kvp.Key), kvp => (kvp.Value, kvp.Key)); 138_specialTokensReverse = specialTokens.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 269var vocab = new ReadOnlyDictionary<string, int>(_vocab.ToDictionary(kvp => kvp.Value.Token, kvp => kvp.Value.Id));
Model\TiktokenTokenizer.cs (1)
991internal IReadOnlyDictionary<string, int> Vocabulary => _vocabOriginal ??= _vocab.ToDictionary(kvp => kvp.Key.Data!, kvp => kvp.Value.Id);
Model\WordPieceTokenizer.cs (1)
45SpecialTokensReverse = options.SpecialTokens is not null ? options.SpecialTokens.GroupBy(kvp => kvp.Value).ToDictionary(g => g.Key, g => g.First().Key) : null;
Utils\ByteToUnicodeEncoding.cs (2)
22.ToDictionary(b => (char)b, b => (char)b); 36UnicodeToByte = ByteToUnicode.ToDictionary(kv => kv.Value, kv => kv.Key);
Microsoft.ML.Tokenizers.Tests (8)
BpeTests.cs (2)
316var reverseVocabulary = bpe.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 814private static IReadOnlyDictionary<int, string> _vocabReverse = _deepSeekR1Tokenizer.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
CodeGenTests.cs (2)
498var reverseVocab = codeGenTokenizer.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 499var reverseSpecialTokens = codeGenTokenizer.SpecialTokens?.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
EnglishRobertaTests.cs (1)
287var reverseVocab = robertaModel.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
LlamaTests.cs (1)
253var reverseVocabulary = bpe.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
src\Microsoft.ML.Tokenizers\Utils\ByteToUnicodeEncoding.cs (2)
22.ToDictionary(b => (char)b, b => (char)b); 36UnicodeToByte = ByteToUnicode.ToDictionary(kv => kv.Value, kv => kv.Key);
Microsoft.NET.Build.Tasks (7)
DependencyContextBuilder.cs (1)
353var libraries = runtimeLibraries.ToDictionary(lib => lib.Library.Name, lib => lib);
GetPackagesToPrune.cs (3)
223.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 235return overrides.ToDictionary(o => o.id, o => o.version); 248?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
ResolvePackageDependencies.cs (1)
146_targetNameToAliasMap = LockFile.Targets.ToDictionary(t => t.Name, t =>
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (2)
25ManifestVersions = manifests.ToDictionary(m => new ManifestId(m.Id), m => (new ManifestVersion(m.Version), new SdkFeatureBand(m.ManifestFeatureBand))) 58}).ToDictionary(t => t.id, t => (t.manifestVersion, t.manifestFeatureBand));
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (1)
UpgradeLegacyWasmStaticWebAssets.cs (1)
26.ToDictionary(g => g.Key, g => g.ToArray());
Microsoft.NET.Sdk.StaticWebAssets.Tasks (4)
FingerprintPatternMatcher.cs (1)
24.ToDictionary(
MergeStaticWebAssets.cs (1)
35.ToDictionary(g => g.Key, g => g.ToList());
UpdateStaticWebAssetEndpoints.cs (2)
46.ToDictionary(e => e.Key, e => e.ToHashSet()); 49.ToDictionary(e => e.Key, e => e.ToHashSet());
Microsoft.NET.Sdk.WorkloadManifestReader (2)
WorkloadSet.cs (2)
25ManifestVersions = manifests.ToDictionary(m => new ManifestId(m.Id), m => (new ManifestVersion(m.Version), new SdkFeatureBand(m.ManifestFeatureBand))) 58}).ToDictionary(t => t.id, t => (t.manifestVersion, t.manifestFeatureBand));
Microsoft.TemplateEngine.Abstractions (4)
Parameters\ParameterDefinitionSet.cs (1)
30: this(parameters?.ToDictionary(p => p.Name, p => p))
Parameters\ParameterSetData.cs (3)
21_parametersData = parameterData.ToDictionary(d => d.ParameterDefinition, d => d); 40: this(templateInfo, inputParameters?.ToDictionary(p => p.Key, p => (object?)p.Value)) 52_parametersData = templateInfo.ParameterDefinitions.ToDictionary(p => p, p =>
Microsoft.TemplateEngine.Cli (4)
Alias\AliasModel.cs (1)
17CommandAliases = new Dictionary<string, IReadOnlyList<string>>(commandAliases.ToDictionary(x => x.Key, x => x.Value), StringComparer.OrdinalIgnoreCase);
Commands\create\TemplateCommand.cs (1)
325.ToDictionary(p => p.Parameter, p => p.Errors);
Commands\create\TemplateCommandArgs.cs (1)
77.ToDictionary(kvp => kvp.Key, kvp => kvp.Item2);
TemplateResolution\TemplateMatchInfoExtensions.cs (1)
17.ToDictionary(x => x.Name, x => x.Value);
Microsoft.TemplateEngine.Edge (8)
Installers\NuGet\NuGetManagedTemplatePackage.cs (1)
70Details = details?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) ?? throw new ArgumentNullException(nameof(details));
Template\InputDataSet.cs (3)
24_parametersData = parameterData.ToDictionary(d => d.ParameterDefinition, d => d); 44: this(templateInfo, inputParameters.ToDictionary(p => p.Key, p => (object?)p.Value)) 49_parametersData = templateInfo.ParameterDefinitions.ToDictionary(p => p, p =>
Template\ParameterSetBuilder.cs (4)
21_resolvedValues = parameters.ToDictionary(p => p.Value, p => new EvalData(p.Value)); 77.ToDictionary(k => k.Key, k => k.Value.Value); 199.ToDictionary(p => p.ParameterDefinition.Name, p => p); 202variables.ToDictionary(p => p.Key, p => p.Value.Value!);
Microsoft.TemplateEngine.Utils (4)
DirectedGraph.cs (4)
46var inDegreeLookup = _vertices.ToDictionary(v => v, v => 0); 111.ToDictionary(p => p.Key, p => new HashSet<T>(p.Value.Where(dependentVertices.Contains))); 149var dependentsMap = vertices.ToDictionary(v => v, v => new HashSet<T>()); 164.ToDictionary(kp => kp.Key, kp => kp.Value == null ? new() : new HashSet<T>(kp.Value));
Microsoft.TestPlatform.CrossPlatEngine (4)
Client\Parallel\ParallelProxyDiscoveryManager.cs (1)
69.ToDictionary(pair => pair.Key, pair => pair.Value);
Client\Parallel\ParallelProxyExecutionManager.cs (2)
88.ToDictionary(pair => pair.Key, pair => pair.Value); 250Dictionary<string, TestCase[]> sourceToTestCasesMap = testRunCriteria.Tests.GroupBy(t => t.Source).ToDictionary(k => k.Key, v => v.ToArray());
TestSession\ProxyTestSessionManager.cs (1)
98.ToDictionary(pair => pair.Key, pair => pair.Value);
Microsoft.VisualStudio.TestPlatform.Common (1)
ExtensionFramework\Utilities\TestExtensions.cs (1)
127.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Microsoft.VisualStudio.TestPlatform.ObjectModel (1)
Nuget.Frameworks\FrameworkNameProvider.cs (1)
1128.ToDictionary(g => g.Key, g => new HashSet<string>(g, StringComparer.OrdinalIgnoreCase));
NuGet.Commands (2)
PackagesLockFileBuilder.cs (1)
91.ToDictionary(l => new PackageIdentity(l.Name, l.Version), l => l.MSBuildProject);
RestoreCommand\RestoreCommand.cs (1)
1336.ToDictionary(dep => new PackageIdentity(dep.Id, dep.ResolvedVersion), val => val.ContentHash);
NuGet.Configuration (4)
Settings\Items\AddItem.cs (1)
28).ToDictionary(a => a.Key, a => a.Value));
Settings\Items\PackageSourceMappingSourceItem.cs (1)
158Dictionary<PackagePatternItem, PackagePatternItem> otherPatterns = packageSourceMappingSourceItem.Patterns.GroupBy(item => item).ToDictionary(c => c.Key, c => c.Key);
Settings\Items\TrustedSignerItem.cs (1)
121var otherCerts = trustedSigner.Certificates.ToDictionary(c => c, c => c);
Settings\SettingItem.cs (1)
65var otherAttributes = setting.Attributes.ToDictionary(a => a.Key, a => a.Value);
NuGet.Frameworks (1)
FrameworkNameProvider.cs (1)
1140.ToDictionary(g => g.Key, g => new HashSet<string>(g, StringComparer.OrdinalIgnoreCase));
NuGet.PackageManagement (2)
Resolution\PrunePackageTree.cs (1)
69var packagesDict = packages.ToLookup(p => p.Id).ToDictionary(p => p.Key, p => p.ToArray());
Utility\XElementExtensions.cs (1)
235var sourceAttr = source.Attributes().ToDictionary(a => a.Name, a => a.Value);
NuGet.Packaging (4)
ContentModel\ContentQueryDefinition.cs (1)
109Defaults = defaults.ToDictionary(p => p.Key, p => p.Value);
ContentModel\Infrastructure\Parser.cs (1)
21_defaults = pattern.Defaults.ToDictionary(p => p.Key, p => p.Value);
PackageCreation\Extensions\XElementExtensions.cs (1)
129var sourceAttr = source.Attributes().ToDictionary(a => a.Name, a => a.Value);
Rules\ReferencesInNuspecMatchRefAssetsRule.cs (1)
40nuspecReferences = targetFrameworks.ToDictionary(k => NuGetFramework.Parse(k.Value).GetShortFolderName(),
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
54var itemToItemsBefore = items.ToDictionary(item => item, item =>
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
23return dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.AsImmutable());
sdk-tasks (1)
CalculateTemplateVersions.cs (1)
48.ToDictionary(g => g.Key, g =>
Shared.Tests (1)
JsonSchemaExporter\TestTypes.cs (1)
1172private readonly IReadOnlyDictionary<TKey, TValue> _dictionary = values.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
System.CommandLine.StaticCompletions (1)
shells\FishShellProvider.cs (1)
34var stateIdByCommand = states.ToDictionary(s => s.cmd, s => s.id);
System.Composition.TypedParts (2)
System\Composition\Hosting\SinglePartExportDescriptorProvider.cs (1)
30var subsetOfConstraints = contract.MetadataConstraints.Where(c => Metadata.ContainsKey(c.Key)).ToDictionary(c => c.Key, c => Metadata[c.Key]);
System\Composition\TypedParts\TypedPartExportDescriptorProvider.cs (1)
89var subsettedConstraints = contract.MetadataConstraints.Where(c => export.Metadata.ContainsKey(c.Key)).ToDictionary(c => c.Key, c => export.Metadata[c.Key]);