206 references to ToDictionary
Aspire.Dashboard (2)
Components\Controls\Chart\MetricTable.razor.cs (1)
126var traceValuesByPercentile = traces.ToDictionary(trace => trace.Percentile!.Value, trace => trace.Values[iTmp]);
Otlp\Model\OtlpApplication.cs (1)
149.ToDictionary(grouping => grouping.Key, grouping => grouping.ToList());
BasicWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
32.ToDictionary(kvp => kvp.Key.Substring("link_".Length), kvp => (object)kvp.Value[0]);
BoundTreeGenerator (1)
BoundNodeClassWriter.cs (1)
41_typeMap = tree.Types.Where(t => t is not (EnumType or ValueType)).ToDictionary(n => n.Name, n => n.Base);
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);
GenericHostWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
32.ToDictionary(kvp => kvp.Key.Substring("link_".Length), kvp => (object)kvp.Value[0]);
InMemory.FunctionalTests (4)
Http2\Http2TestBase.cs (2)
164internal Dictionary<string, object> ConnectionTags => _metricsTagsFeature.Tags.ToDictionary(t => t.Key, t => t.Value); 985.ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray()));
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
96internal Dictionary<string, object> ConnectionTags => MultiplexedConnectionContext.Tags.ToDictionary(t => t.Key, t => t.Value); 715.ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray()));
IOperationGenerator (2)
IOperationClassWriter.cs (2)
34_typeMap = _tree.Types.OfType<AbstractNode>().ToDictionary(t => t.Name, t => (AbstractNode?)t); 317.ToDictionary(g => g.Key, g => g.Select(k => (entryName: k.entry, k.node)));
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
70additionalEnabledDiagnostics.ToDictionary(s => s, s => ReportDiagnostic.Info));
DiagnosticVerifier.cs (1)
90additionalEnabledDiagnostics.ToDictionary(s => s, s => ReportDiagnostic.Info));
Microsoft.AspNetCore.App.Analyzers.Test (2)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (2)
175spans = tempSpans.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 223spans = dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableArray());
Microsoft.AspNetCore.Authentication.Test (5)
OpenIdConnect\OpenIdConnectTests.cs (2)
244.ToDictionary(pair => pair[0], pair => pair[1]); 275.ToDictionary(pair => pair[0], pair => pair[1]);
OpenIdConnect\TestSettings.cs (3)
63.ToDictionary(elem => elem.Attribute("name").Value, 101.ToDictionary(elem => elem.Attribute("name").Value, 141redirectUri.Query.TrimStart('?').Split('&').Select(part => part.Split('=')).ToDictionary(parts => parts[0], parts => parts[1]);
Microsoft.AspNetCore.BrowserTesting (1)
BrowserManagerConfiguration.cs (1)
134argsMap => argsMap.ToDictionary(kvp => kvp.Key, kvp => string.Join(", ", kvp.Value))),
Microsoft.AspNetCore.Components (1)
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.Components.Tests (3)
Lifetime\ComponentStatePersistenceManagerTest.cs (2)
275State = state.ToDictionary(k => k.Key, v => v.Value); 303State = state.ToDictionary(k => k.Key, v => v.Value);
Routing\RouteTableFactoryTests.cs (1)
1143.ToDictionary(group => group.Key, group => group.Select(g => g.Template).ToArray());
Microsoft.AspNetCore.Components.Web.Tests (1)
Forms\EditFormTest.cs (1)
200.ToDictionary(f => f.AttributeName, f => f.AttributeValue);
Microsoft.AspNetCore.Components.WebAssembly.Tests (4)
Hosting\WebAssemblyHostConfigurationTest.cs (4)
96var section = configuration.GetSection("wheels").AsEnumerable(makePathsRelative: true).ToDictionary(k => k.Key, v => v.Value); 161var dict = configuration.GetSection("Mem1").AsEnumerable(makePathsRelative: true).ToDictionary(k => k.Key, v => v.Value); 167var dict2 = configuration.GetSection("Mem2").AsEnumerable(makePathsRelative: true).ToDictionary(k => k.Key, v => v.Value); 173var dict3 = configuration.GetSection("Mem3").AsEnumerable(makePathsRelative: true).ToDictionary(k => k.Key, v => v.Value);
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
401.ToDictionary(f => f.GetValue(null)!,
Microsoft.AspNetCore.Grpc.Swagger (1)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
401.ToDictionary(f => f.GetValue(null)!,
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
RouteValueDictionaryTests.cs (2)
87yield return new object[] { routeValues.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) }; 106yield return new object[] { routeValues.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) };
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Infrastructure\ServerFactory.cs (1)
103var relatedParts = relatedAssemblies.ToDictionary(
Microsoft.AspNetCore.Mvc.Core.Test (6)
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (1)
441var binders = bindingContext.ModelMetadata.Properties.ToDictionary(
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (2)
597var binders = bindingContext.ModelMetadata.Properties.ToDictionary( 619var binders = bindingContext.ModelMetadata.Properties.ToDictionary(
ModelBinding\Binders\DictionaryModelBinderTest.cs (3)
288var stringDictionary = dictionary.ToDictionary(kvp => kvp.Key.ToString(CultureInfo.InvariantCulture), kvp => kvp.Value.ToString(CultureInfo.InvariantCulture)); 641var backingStore = dictionary.ToDictionary( 657var backingStore = dictionary.ToDictionary(
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
InputValidationTests.cs (1)
89.ToDictionary(
Microsoft.AspNetCore.Mvc.TagHelpers.Test (2)
PrerenderComponentApplicationStoreTest.cs (1)
45expected.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToArray()),
ProtectedPrerenderComponentApplicationStateTest.cs (1)
53expectedState.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToArray()),
Microsoft.AspNetCore.OpenApi (1)
Extensions\OpenApiSchemaExtensions.cs (1)
51Properties = schema.Properties?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Clone()),
Microsoft.AspNetCore.OpenApi.Microbenchmarks (1)
OpenApiSchemaComparerBenchmark.cs (1)
46Properties = Enumerable.Range(0, 10).ToDictionary(i => i.ToString(CultureInfo.InvariantCulture), _ => new OpenApiSchema()),
Microsoft.AspNetCore.Routing (1)
Patterns\RoutePatternFactory.cs (1)
537? parameterPolicyReferences.ToDictionary(kvp => kvp.Key, kvp => (IReadOnlyList<RoutePatternParameterPolicyReference>)kvp.Value.ToArray())
Microsoft.AspNetCore.Routing.Tests (1)
Template\TemplateBinderTests.cs (1)
1457.ToDictionary(pair => pair[0], pair => pair[1]);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\ConfigSectionClone.cs (1)
19Children = children.ToDictionary(child => child.Key, child => new ConfigSectionClone(child));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
ConnectionDispatcherTests.cs (1)
45var pairs = scopeObjects[0].ToDictionary(p => p.Key, p => p.Value);
Http2\Http2HPackEncoderTests.cs (1)
664.ToDictionary(g => g.Key, g => new StringValues(g.Select(gg => gg.Value).ToArray()));
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
96internal Dictionary<string, object> ConnectionTags => MultiplexedConnectionContext.Tags.ToDictionary(t => t.Key, t => t.Value); 715.ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray()));
Microsoft.Build (8)
BackEnd\BuildManager\RequestedProjectState.cs (1)
51result.ItemFilters = ItemFilters.ToDictionary(
Evaluation\Evaluator.cs (1)
849var 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)
1255var e = new BuildCheckTracingEventArgs(rawTracingData.ToDictionary(
Logging\ParallelLogger\ParallelConsoleLogger.cs (1)
240WriteEnvironment(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,
Logging\SerialConsoleLogger.cs (1)
113WriteEnvironment(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
Microsoft.Build.Engine.UnitTests (13)
BackEnd\NodePackets_Tests.cs (1)
186new TaskItemData("ItemSpec2", Enumerable.Range(1, 3).ToDictionary(i => i.ToString(), i => i.ToString() + "value"))
BackEnd\TranslationHelpers.cs (1)
173.ToDictionary(
BuildEventArgsSerialization_Tests.cs (1)
725new TaskItemData("ItemSpec2", Enumerable.Range(1,3).ToDictionary(i => i.ToString(), i => i.ToString() + "value"))
Graph\GraphLoadedFromSolution_tests.cs (2)
212var projectSpecificConfigurations = graph.ProjectNodes.ToDictionary( 214n => solutionConfigurations.ToDictionary(
Instance\ProjectInstance_Internal_Tests.cs (1)
1037template.Properties.ToDictionary(p => p.Key, p => p.Value.EvaluatedValue),
ProjectCache\ProjectCacheTests.cs (3)
1366referenceNumbers.ToDictionary(k => k, k => GraphCacheResponse.SuccessfulProxyTargetResult())); 1459referenceNumbers.ToDictionary(k => k, k => GraphCacheResponse.SuccessfulProxyTargetResult())); 1522referenceNumbers.ToDictionary(k => k, k => GraphCacheResponse.SuccessfulProxyTargetResult()));
SolutionFileBuilder.cs (4)
94Projects = graph.ProjectNodes.ToDictionary( 105var projectInfos = Projects.ToDictionary( 134ProjectConfigurations ??= projectInfos.ToDictionary( 136p => SolutionConfigurationPlatforms.ToDictionary(
Microsoft.Build.Tasks.Core (1)
SystemState.cs (1)
613instanceLocalOutgoingFileStateCache = 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.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
54var itemToItemsBefore = items.ToDictionary(item => item, item =>
Microsoft.CodeAnalysis.EditorFeatures (1)
Shared\Extensions\HostWorkspaceServicesExtensions.cs (1)
81return hostWorkspaceServices.SupportedLanguages.ToDictionary(
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\EditorTestWorkspace.cs (1)
457mappedMarkupSpans = tempMappedMarkupSpans.ToDictionary(
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (1)
708var expectedMap = expected.ToDictionary(entry => (entry.diagnosticId, entry.optionName), entry => entry.optionValue);
EditorConfigSettings\Data\CodeStyleSettingsTest.cs (1)
105=> _dictionary = options?.ToDictionary(x => x.Item1, x => x.Item2) ?? [];
Microsoft.CodeAnalysis.Features (7)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
1476map.ToDictionary(keySelector: entry => entry.Value, elementSelector: entry => entry.Key),
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
42.ToDictionary(location => location, _ => new SyntaxAnnotation());
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (2)
108.ToDictionary( 133.ToDictionary(
ExtractMethod\MethodExtractor.cs (1)
196var tokenMap = annotations.GroupBy(p => p.Item1, p => p.Item2).ToDictionary(g => g.Key, g => g.ToArray());
ExtractMethod\SelectionResult.cs (2)
217var tokenMap = pairs.GroupBy(p => p.Item1, p => p.Item2).ToDictionary(g => g.Key, g => g.ToArray()); 230var tokenMap = pairs.GroupBy(p => p.Item1, p => p.Item2).ToDictionary(g => g.Key, g => g.ToArray());
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueTestAnalyzerConfigOptions.cs (1)
17=> _options = options.ToDictionary(e => e.key, e => e.value);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Features\CodeFixes\CodeFixService.cs (1)
1002_fixerToIndex = allFixers.Select((fixer, index) => (fixer, index)).ToDictionary(t => t.fixer, t => t.index);
Protocol\SumType.cs (1)
900=> dictionary.ToDictionary(kvp => kvp.Key, kvp => (object)kvp.Value);
Microsoft.CodeAnalysis.Test.Utilities (8)
Compilation\TestSyntaxTreeOptionsProvider.cs (2)
23_options = options.ToDictionary( 58_isGenerated = isGenerated.ToDictionary(
MarkedSource\MarkupTestFile.cs (2)
177spans = tempSpans.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 227spans = dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableAndFree());
Mocks\TestSourceReferenceResolver.cs (3)
22return new TestSourceReferenceResolver(sources.ToDictionary(p => p.Key, p => (object)p.Value)); 27return new TestSourceReferenceResolver(sources.ToDictionary(p => p.Key, p => p.Value)); 32return new TestSourceReferenceResolver(sources.ToDictionary(p => p.Key, p => (object)p.Value));
TestableFileSystem.cs (1)
66var map = files.ToDictionary(
Microsoft.CodeAnalysis.UnitTests (4)
Collections\List\CollectionAsserts.cs (4)
85Assert.Equal(e.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count()), a.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count())); 104Assert.Equal(e.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count()), a.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count()));
Microsoft.CodeAnalysis.Workspaces (2)
CodeCleanup\AbstractCodeCleanerService.cs (1)
595var tokenMap = map.ToDictionary(p => p.Key, p => p.Value);
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)
65var groupings = df.GroupBy<int>("Tens").Groupings.ToDictionary(g => g.Key, g => g.ToList());
Microsoft.DotNet.AsmDiff (1)
MefHelpers.cs (1)
47var subsetOfConstraints = contract.MetadataConstraints.Where(c => Metadata.ContainsKey(c.Key)).ToDictionary(c => c.Key, c => Metadata[c.Key]);
Microsoft.DotNet.Build.Tasks.Installers (1)
src\CreateRpmPackage.cs (1)
121Dictionary<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)
272Dictionary<string, bool> pathHasMatches = EffectiveLibPackageExcludes.ToDictionary(
PromoteDependencies.cs (2)
48var refSets = dependencies.Where(d => d.Id != "_._").Where(d => d.IsReference).GroupBy(d => NuGetFramework.Parse(d.TargetFramework)).ToDictionary(g => g.Key, g => g.ToArray()); 53var 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.Helix.Client (1)
generated-code\HelixApi.cs (1)
279Headers = request.Headers.ToDictionary(h => h.Name, h => h.Value);
Microsoft.DotNet.Helix.JobSender (1)
JobDefinition.cs (1)
181(await Task.WhenAll(CorrelationPayloads.Select(async p => (uri: await p.Key.UploadAsync(storageContainer, log, cancellationToken), destination: p.Value)))).ToDictionary(x => x.uri, x => x.destination);
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.SignTool.Tests (1)
SignToolTests.cs (1)
1181var tempFileExtensionSignInfo = s_fileExtensionSignInfo.Where(s => s.Key != ".symbols.nupkg").ToDictionary(e => e.Key, e => e.Value);
Microsoft.DotNet.VersionTools (3)
Automation\VersionsRepoUpdater.cs (1)
33return infos.ToDictionary(i => i.Id, i => i.Version);
BuildManifest\Model\XElementParsingExtensions.cs (1)
26return element.Attributes().ToDictionary(a => a.Name.LocalName, a => a.Value);
Dependencies\BuildOutput\BuildDependencyInfo.cs (1)
43.ToDictionary(pair => pair.Key, pair => pair.Value);
Microsoft.DotNet.XliffTasks (1)
Tasks\TransformTemplates.cs (1)
93Dictionary<string, string> defaultTranslation = document.Nodes.ToDictionary(node => node.Id, node => node.Source);
Microsoft.Extensions.Diagnostics.Testing.Tests (2)
Logging\FakeLoggerTests.cs (2)
88var ss = logger.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 104ss = 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 (3)
LogPropertiesTests.cs (3)
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);
Microsoft.Interop.ComInterfaceGenerator (1)
ComMethodContext.cs (1)
163var ifaceToDeclaredMethodsMap = ifaceAndDeclaredMethods.ToDictionary(static pair => pair.Item1, static pair => pair.Item2);
Microsoft.ML.AutoML (15)
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\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 (12)
Model\BertTokenizer.cs (1)
772Dictionary<string, int> dic = options.SpecialTokens.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Model\BPETokenizer.cs (3)
259_specialTokens = specialTokens.ToDictionary(kvp => new StringSpanOrdinalKey(kvp.Key), kvp => (kvp.Value, kvp.Key)); 260_specialTokensReverse = specialTokens.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 609public IReadOnlyDictionary<string, int> Vocabulary => _vocabOriginal ??= new ReadOnlyDictionary<string, int>(_vocab.ToDictionary(kvp => kvp.Key.Data!, kvp => kvp.Value));
Model\CodeGenTokenizer.cs (4)
125_vocabReverse = _vocab.ToDictionary(kvp => kvp.Value.Id, kvp => kvp.Value.Token); 134_specialTokens = specialTokens.ToDictionary(kvp => new StringSpanOrdinalKey(kvp.Key), kvp => (kvp.Value, kvp.Key)); 135_specialTokensReverse = specialTokens.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 266var 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.ToDictionary(kvp => kvp.Value, kvp => kvp.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 (5)
BpeTests.cs (1)
272var reverseVocabulary = bpe.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);
Microsoft.VisualStudio.LanguageServices (5)
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (1)
147return map.ToDictionary(kv => kv.Key, kv => (IEnumerable<DiagnosticDescriptor>)kv.Value);
EditorConfigSettings\Whitespace\ViewModel\IndentationSizeViewModel.cs (1)
109return EnumerateOptions().ToDictionary(x => x.description, x => x.value);
EditorConfigSettings\Whitespace\ViewModel\NewLineViewModel.cs (1)
87return EnumerateOptions().ToDictionary(x => x.description, x => x.value);
EditorConfigSettings\Whitespace\ViewModel\OperatorPlacementWhenWrappingViewModel.cs (1)
71return EnumerateOptions().ToDictionary(x => x.description, x => x.value);
EditorConfigSettings\Whitespace\ViewModel\TabSizeViewModel.cs (1)
41return EnumerateOptions().ToDictionary(x => x.description, x => x.value);
Microsoft.VisualStudio.LanguageServices.CSharp (2)
EditorConfigSettings\BinaryOperatorSpacingOptionsViewModel.cs (1)
34return EnumerateOptions().ToDictionary(x => x.description, x => x.value);
EditorConfigSettings\LabelPositionOptionsViewModel.cs (1)
57return EnumerateOptions().ToDictionary(x => x.description, x => x.value);
Mvc.Api.Analyzers.Test (1)
IgnoreCS1701WarningCodeFixRunner.cs (1)
14return options.WithSpecificDiagnosticOptions(new[] { "CS1701" }.ToDictionary(c => c, _ => ReportDiagnostic.Suppress));
Mvc.RoutingWebSite (2)
Controllers\LG1Controller.cs (1)
130return new RouteValueDictionary(query.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToString()));
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
32.ToDictionary(kvp => kvp.Key.Substring("link_".Length), kvp => (object)kvp.Value[0]);
SemanticSearch.BuildTask (1)
GenerateFilteredReferenceAssembliesTask.cs (1)
87var referencesByName = References.ToDictionary(r => Path.GetFileNameWithoutExtension(r.ItemSpec), r => r.ItemSpec);
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]);
TagHelpersWebSite (1)
TagHelpers\ATagHelper.cs (1)
34var methodParameters = output.Attributes.ToDictionary(attribute => attribute.Name,
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\E2ETesting\E2ETestOptions.cs (1)
27.ToDictionary(kvp => kvp.Key.Substring(TestingOptionsPrefix.Length + 1), kvp => kvp.Value);
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\E2ETesting\E2ETestOptions.cs (1)
27.ToDictionary(kvp => kvp.Key.Substring(TestingOptionsPrefix.Length + 1), kvp => kvp.Value);
Templates.Mvc.Tests (1)
src\Shared\E2ETesting\E2ETestOptions.cs (1)
27.ToDictionary(kvp => kvp.Key.Substring(TestingOptionsPrefix.Length + 1), kvp => kvp.Value);
Templates.Tests (1)
src\Shared\E2ETesting\E2ETestOptions.cs (1)
27.ToDictionary(kvp => kvp.Key.Substring(TestingOptionsPrefix.Length + 1), kvp => kvp.Value);
VersioningWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
32.ToDictionary(kvp => kvp.Key.Substring("link_".Length), kvp => (object)kvp.Value[0]);
Wasm.Performance.TestApp (1)
Person.cs (1)
27.ToDictionary(c => c, _ => rng.Next(0, 2) == 0),
xunit.assert (1)
Sdk\AssertHelper.cs (1)
169 .ToDictionary(g => g.name, g => g.getter);