4805 references to Select
AnalyzerRunner (2)
CodeRefactoringRunner.cs (1)
180foreach (var refactoring in refactorings.Select(refactoring => refactoring.Value))
DiagnosticAnalyzerRunner.cs (1)
436var longestAnalyzerName = telemetryInfoDictionary.Select(x => x.Key.GetType().Name.Length).Max();
ApiExplorerWebSite (1)
ApiExplorerDataFilter.cs (1)
77ConstraintTypes = parameter.RouteInfo.Constraints?.Select(c => c.GetType().Name).ToArray(),
Aspire.Azure.AI.OpenAI.Tests (1)
AspireAzureOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (1)
224return Task.FromResult(new GeneratedEmbeddings<Embedding<float>>(inputs.Select(i => new Embedding<float>(floats))));
Aspire.Azure.Security.KeyVault.Tests (2)
MockTransport.cs (2)
116protected override IEnumerable<HttpHeader> EnumerateHeaders() => _headers.Select(h => new HttpHeader(h.Key, JoinHeaderValue(h.Value))); 207protected override IEnumerable<HttpHeader> EnumerateHeaders() => _headers.Select(h => new HttpHeader(h.Key, JoinHeaderValue(h.Value)));
Aspire.Dashboard (16)
Components\Controls\Chart\ChartBase.cs (1)
195return (traces.Select(kvp => kvp.Value).ToList(), xValues, exemplars);
DashboardWebApplication.cs (2)
279.Select(c => c.Name) 302builder.WithOrigins(_frontendEndPointAccessor.Select(accessor => accessor().GetResolvedAddress()).ToArray());
Extensions\TelemetryFilterFormatter.cs (2)
31return string.Join(" ", filters.Select(SerializeFilterToString)); 86.Select(DeserializeFilterFromString)
Model\TraceHelpers.cs (1)
80return appFirstTimes.Select(kvp => kvp.Value)
Otlp\Model\OtlpHelpers.cs (1)
406items = query.Select(select).ToList();
Otlp\Model\OtlpInstrument.cs (1)
94var keys = KnownAttributeValues.Keys.Union(durableAttributes.Select(a => a.Key)).Distinct();
Otlp\Storage\TelemetryRepository.cs (2)
447var keys = applicationKeys.Select(keys => keys.PropertyKey).Distinct(); 474var keys = applicationKeys.Select(keys => keys.PropertyKey).Distinct();
ResourceService\Partials.cs (4)
52HealthReports = HealthReports.Select(ToHealthReportViewModel).OrderBy(vm => vm.Name).ToImmutableArray(), 79.Select(e => new EnvironmentVariableViewModel(e.Name, e.Value, e.IsFromSpec)) 86.Select(r => new RelationshipViewModel(r.ResourceName, r.Type)) 110.Select(c => new CommandViewModel(c.Name, MapState(c.State), c.DisplayName, c.DisplayDescription, c.ConfirmationMessage, c.Parameter, c.IsHighlighted, c.IconName, MapIconVariant(c.IconVariant)))
src\Shared\IConfigurationExtensions.cs (1)
112.Select(url => new Uri(url, UriKind.Absolute))
Utils\GlobalizationHelpers.cs (1)
30LocalizedCultures = localizedCultureNames.Select(CultureInfo.GetCultureInfo).ToList();
Aspire.Dashboard.Components.Tests (1)
tests\Shared\Logging\LogValuesAssert.cs (1)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]"));
Aspire.Dashboard.Tests (6)
GlobalizationHelpersTests.cs (1)
18.Select(c => c.Name)
Integration\ServerRetryHelper.cs (1)
75AddEndpoints(startingPort, unavailableEndpoints, properties.GetActiveTcpConnections().Select(c => c.LocalEndPoint));
Model\ResourceSourceViewModelTests.cs (1)
26properties.TryAdd(KnownProperties.Executable.Args, new ResourcePropertyViewModel(KnownProperties.Executable.Args, Value.ForList(testData.ExecutableArguments.Select(Value.ForString).ToArray()), false, null, 0, new BrowserTimeProvider(new NullLoggerFactory())));
TelemetryRepositoryTests\TraceTests.cs (2)
951var actualOrder = traces.PagedResult.Items.Select(t => t.TraceId).ToList(); 952var expectedOrder = traces.PagedResult.Items.OrderBy(t => t.FirstSpan.StartTime).Select(t => t.TraceId).ToList();
tests\Shared\Logging\LogValuesAssert.cs (1)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]"));
Aspire.EndToEnd.Tests (4)
tests\Shared\WorkloadTesting\BuildEnvironment.cs (1)
99.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (3)
47.Select(id => GetPackagePath(buildEnvironment.BuiltNuGetsPath, id)) 91throw new ArgumentException($"Cannot find {templatePackageId}*.nupkg in {builtNuGetsPath}. Packages found in {builtNuGetsPath}: {string.Join(", ", Directory.EnumerateFiles(builtNuGetsPath).Select(Path.GetFileName))}"); 95throw new ArgumentException($"Found more than one {templatePackageId}*.nupkg in {builtNuGetsPath}: {string.Join(", ", packages.Select(Path.GetFileName))}");
Aspire.Hosting (9)
ApplicationModel\ResourceExtensions.cs (1)
253return endpoints.Select(e => new EndpointReference(resource, e));
ApplicationModel\ResourceLoggerService.cs (1)
171var readTasks = resourceNames.Select(async (name) =>
Dashboard\ResourceSnapshot.cs (2)
62IEnumerable<string> list => Value.ForList(list.Select(Value.ForString).ToArray()), 63IEnumerable<int> list => Value.ForList(list.Select(i => Value.ForNumber(i)).ToArray()),
Dcp\ApplicationExecutor.cs (2)
472= serviceProducerAnnotations.Select(e => e.ServiceName).ToList(); 816return container.Spec.VolumeMounts?.Select(v => new VolumeSnapshot(v.Source, v.Target ?? "", v.Type, v.IsReadOnly)).ToImmutableArray() ?? [];
DistributedApplicationBuilder.cs (2)
335var healthCheckRegistrationKeys = options.Registrations.Select(hcr => hcr.Name).ToHashSet(); 409.Select(g => g.Key))
src\Shared\IConfigurationExtensions.cs (1)
112.Select(url => new Uri(url, UriKind.Absolute))
Aspire.Hosting.Analyzers (3)
AppHostAnalyzer.cs (3)
90parameterData = candidateParameters.Select(p => (p.Symbol, p.ModelTypes)).ToArray(); 108var modelTypes = attrData.Select(a => 115return modelTypes.Where(m => m is not null).Select(m => m.Value).ToArray();
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\BicepProvisioner.cs (1)
500IEnumerable<string> s => new JsonArray(s.Select(s => JsonValue.Create(s)).ToArray()),
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppsInfrastructure.cs (3)
265throw new NotSupportedException($"The endpoint(s) {string.Join(", ", unsupportedEndpoints.Select(e => $"'{e.Name}'"))} specify an unsupported scheme. The supported schemes are 'http', 'https', and 'tcp'."); 346.Select(g => new 353UniqueSchemes = g.Select(e => e.UriScheme).Distinct().ToArray(),
Aspire.Hosting.Azure.Tests (1)
AzureBicepProvisionerTests.cs (1)
65Assert.Equal(["a", "b", "c"], parameters["values"]?["value"]?.AsArray()?.Select(v => v?.ToString()) ?? []);
Aspire.Hosting.Dapr (3)
DaprDistributedApplicationLifecycleHook.cs (3)
71var aggregateResourcesPaths = sidecarOptions?.ResourcesPaths.Select(path => NormalizePath(path)).ToHashSet() ?? new HashSet<string>(); 249context.Writer.TryWriteStringArray("components", componentReferenceAnnotations.Select(componentReferenceAnnotation => componentReferenceAnnotation.Component.Name)); 263context.Writer.TryWriteStringArray("resourcesPath", sidecarOptions?.ResourcesPaths.Select(path => context.GetManifestRelativePath(path)));
Aspire.Hosting.Testing.Tests (3)
TestingBuilderTests.cs (2)
22var realBuilderProperties = typeof(IDistributedApplicationBuilder).GetProperties().Select(p => p.Name).ToList(); 23var testBuilderProperties = typeof(IDistributedApplicationTestingBuilder).GetProperties().Select(p => p.Name).ToList();
tests\Shared\Logging\LogValuesAssert.cs (1)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]"));
Aspire.Hosting.Tests (6)
Schema\SchemaTests.cs (1)
751var errorMessages = results.Details.Where(x => x.HasErrors).SelectMany(e => e.Errors!).Select(e => e.Value);
tests\Shared\Logging\LogValuesAssert.cs (1)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]"));
Utils\StringComparersTests.cs (4)
48var comparerNames = comparers.Select(c => c.Name).ToList(); 49var comparisonNames = comparisons.Select(c => c.Name).ToList(); 68var comparerValues = comparers.Select(c => (c.Name, Value: (StringComparer)c.GetValue(null)!)).ToList(); 69var comparisonValues = comparisons.Select(c => (c.Name, Value: (StringComparison)c.GetValue(null)!)).ToList();
Aspire.OpenAI.Tests (1)
AspireOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (1)
225return Task.FromResult(new GeneratedEmbeddings<Embedding<float>>(inputs.Select(i => new Embedding<float>(floats))));
Aspire.Playground.Tests (6)
AppHostTests.cs (1)
49var tasks = testEndpoints.WaitForTexts.Select(x => app.WaitForTextAsync(log => new Regex(x.Pattern).IsMatch(log), x.ResourceName)).ToArray();
Infrastructure\DistributedApplicationExtensions.cs (3)
55.Select(m => (Resource: r, Volume: m))) 105return Task.WhenAll(applicationModel.Resources.Select(r => resourceNotificationService.WaitForResourceAsync(r.Name, targetStates, cancellationToken))); 133var assertableResourceLogNames = applicationModel.Resources.Where(ShouldAssertErrorsForResource).Select(r => $"{environment.ApplicationName}.Resources.{r.Name}").ToList();
Infrastructure\DistributedApplicationTestFactory.cs (1)
64.Select(cia => new { Resource = r, Annotation = cia }));
tests\Shared\Logging\LogValuesAssert.cs (1)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]"));
Aspire.Workload.Tests (9)
StarterTemplateRunTestsBase.cs (2)
123.Select(cell => cell.InnerHTMLAsync()) 124.Select(t => t.Result)
tests\Shared\WorkloadTesting\BuildEnvironment.cs (1)
99.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (3)
47.Select(id => GetPackagePath(buildEnvironment.BuiltNuGetsPath, id)) 91throw new ArgumentException($"Cannot find {templatePackageId}*.nupkg in {builtNuGetsPath}. Packages found in {builtNuGetsPath}: {string.Join(", ", Directory.EnumerateFiles(builtNuGetsPath).Select(Path.GetFileName))}"); 95throw new ArgumentException($"Found more than one {templatePackageId}*.nupkg in {builtNuGetsPath}: {string.Join(", ", packages.Select(Path.GetFileName))}");
WorkloadTestsBase.cs (3)
185Assert.Fail($"Row with unknown name found: '{resourceName}'. Expected values: {string.Join(", ", expectedRowsTable.Keys.Select(k => $"'{k}'"))}"); 211.Select(async e => await e.InnerTextAsync()) 212.Select(t => t.Result.Trim(','))
AzureSearch.ApiService (1)
Program.cs (1)
156var batchActions = hotels.Select(h => IndexDocumentsAction.Upload(h)).ToArray();
BasicTestApp (2)
AuthTest\ServerAuthenticationStateProvider.cs (1)
30.Concat(data.ExposedClaims.Select(c => new Claim(c.Type, c.Value)));
FormsTest\CustomFieldCssClassProvider.cs (1)
26cssClassName = string.Join(' ', cssClassName.Split(' ').Select(token => token switch
BasicWebSite (1)
Controllers\HomeController.cs (1)
134.Select(part => part.Name)
BlazorServerApp (1)
Data\WeatherForecastService.cs (1)
15return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
BlazorUnitedApp (1)
Data\WeatherForecastService.cs (1)
15return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
BoundTreeGenerator (2)
BoundNodeClassWriter.cs (2)
966var fields = new[] { "this.Syntax" }.Concat(AllSpecifiableFields(node).Select(f => ToCamelCase(f.Name))).Concat(new[] { "this.HasErrors" }); 1014var fields = new[] { "Me.Syntax" }.Concat(AllSpecifiableFields(node).Select(f => ToCamelCase(f.Name))).Concat(new[] { "Me.HasErrors" });
BuildActionTelemetryTable (2)
Program.cs (2)
462return paths.Select(path => 498.Select(GetTelemetryInfo)
BuildBoss (5)
CompilerNuGetCheckerUtil.cs (2)
285foreach (var packageFolder in packageInputs.Select(x => x.PackageFolderRelativePath).Distinct().OrderBy(x => x)) 346.Select(x => x.PackagePart);
OptProfCheckerUtil.cs (1)
110return manifest["files"].Select(f => f["fileName"].ToString()).ToHashSet();
ProjectCheckerUtil.cs (1)
98var declaredList = declaredEntryList.Select(x => x.ProjectKey).ToList();
ProjectUtil.cs (1)
107.Select(x => x.Attribute("Project")?.Value)
BuildValidator (2)
Program.cs (2)
140var artifactsDirs = options.AssembliesPaths.Select(path => new DirectoryInfo(path)); 376var sourceLinks = documents.Select(makeSourceLink).ToImmutableArray();
CodeGenerator (20)
FeatureCollectionGenerator.cs (1)
216return values.Any() ? values.Select(formatter).Aggregate((a, b) => a + b) : "";
HttpUtilities\HttpUtilities.cs (3)
36var methodsInfo = httpMethods.Select(GetMethodStringAndUlongAndMaskLength).ToList(); 40var methodsAsciiStringAsLong = methodsInfo.Select(m => m.AsciiStringAsLong).ToArray(); 122var distinctLengths = methodsInfo.Select(m => m.MaskLength).Distinct().ToList();
src\Servers\Kestrel\shared\KnownHeaders.cs (16)
40.Select(h => h.Name) 79.Concat(FormattedInternalHeaderNames.Select(x => x.Identifier)) 181ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 252ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 279ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 299.Select(header => 1L << header.Index) 303.Where(header => FormattedInternalHeaderNames.Where(x => x.IsPseudoHeader).Select(x => x.Identifier).Contains(header.Identifier)) 304.Select(header => 1L << header.Index) 310return values.Any() ? values.Select(formatter).Aggregate((a, b) => a + b) : ""; 403var useVarForFirstTerm = values.Count > 1 && values.Select(h => h.FirstNameIgnoreCaseSegment()).Distinct().Count() == 1; 404var firstTermVarExpression = values.Select(h => h.FirstNameIgnoreCaseSegment()).FirstOrDefault(); 784.Select(h => h.Identifier).Distinct().OrderBy(n => n, StringComparer.InvariantCulture).ToArray(); 937{Each(ApiHeaderNames.Where(header => header != "ContentLength" && !loop.Headers.Select(kh => kh.Identifier).Contains(header)), header => $@" 1503var groupedHeaders = staticHeaders.GroupBy(h => Encoding.ASCII.GetString(h.HeaderField.Name)).Select(g => 1524var groupedHeaders = staticHeaders.GroupBy(h => Encoding.ASCII.GetString(h.HeaderField.Name)).Select(g => 1530HPackStaticTableIndexes = g.Select(h => h.Index).ToArray()
ConfigurationSchemaGenerator (2)
ConfigSchemaGenerator.cs (1)
21references: references.Select(CreateMetadataReference)
RuntimeSource\Configuration.Binder\Specs\BindingHelperInfo.cs (1)
71: typesAsBase.Select(t => (TSpec)t);
ControllersFromServicesWebSite (2)
Startup.cs (2)
45Types = types.Select(t => t.GetTypeInfo()); 48public override string Name => string.Join(", ", Types.Select(t => t.FullName));
csc (1)
src\Compilers\Shared\BuildClient.cs (1)
129var args = originalArguments.Select(arg => arg.Trim()).ToArray();
CSharpErrorFactsGenerator (1)
Program.cs (1)
42foreach (var line in File.ReadAllLines(inputPath).Select(l => l.Trim()))
CSharpSyntaxGenerator (19)
SourceWriter.cs (19)
332node.Fields.Select(f => $"this.{CamelCase(f.Name)}"), 345node.Fields.Select(f => $"this.{CamelCase(f.Name)}"), 382Write(CommaJoin(node.Fields.Select(f => 415node.Fields.Select(f => CamelCase(f.Name)))); 457Write(CommaJoin(node.Fields.Select(f => 655nd.Fields.Select(f => 672nodeFields.Select(f => 677valueFields.Select(f => CamelCase(f.Name)), 1083node.Fields.Select(f => $"{GetRedPropertyType(f)} {CamelCase(f.Name)}"))); 1106node.Fields.Select(f => CamelCase(f.Name)))); 1151Write(CommaJoin(node.Fields.Select(f => 1307Write(CommaJoin(node.Fields.Select(f => 1486nodeFields.Select(f => 1510valueFields.Select(f => CamelCase(f.Name)))); 1520nd.Fields.Select(f => $"{this.GetRedPropertyType(f)} {CamelCase(f.Name)}"))); 1612nd.Fields.Where(factoryWithNoAutoCreatableTokenFields.Contains).Select( 1619nd.Fields.Select(f => factoryWithNoAutoCreatableTokenFields.Contains(f) 1701nd.Fields.Where(minimalFactoryfields.Contains).Select(f => 1726nd.Fields.Select(f =>
DaprServiceB (1)
Program.cs (1)
26var forecast = Enumerable.Range(1, 5).Select(index =>
DnnAnalyzer (1)
DnnAnalyzer.cs (1)
51.Select(input => input.ToString())
dotnet-dev-certs (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
299var hashes = matches.OfType<Match>().Select(m => m.Groups[1].Value).ToList();
dotnet-getdocument (2)
Commands\InvokeCommand.cs (1)
104.Select(p => p.Name);
src\Tools\GetDocumentInsider\src\ReporterExtensions.cs (1)
34.Select(l => prefix + l));
dotnet-openapi (1)
Internal\OpenapiDependencyAttribute.cs (1)
18CodeGenerators = codeGenerators.Split(';', StringSplitOptions.RemoveEmptyEntries).Select(Enum.Parse<CodeGenerator>).ToArray();
dotnet-svcutil-lib (27)
CommandProcessorOptions.cs (7)
166fileOptions.AddWarning(string.Format(SR.WrnExtraParamsOnInputFileParamIgnoredFormat, disallowedSwitchesOnParamsFilesProvided.Select(s => $"'{s.Name}'").Aggregate((msg, n) => $"{msg}, '{n}'")), 0); 306this.AddWarning(string.Format(SR.WrnUnexpectedInputsFormat, this.Inputs.Select(i => $"{i}''").Aggregate((msg, i) => $"{msg}, {i}"))); 514var svcRefNames = paramsFiles.Select(pf => { PathHelper.GetRelativePath(Path.GetDirectoryName(pf), new DirectoryInfo(projectDir), out var relPath); return relPath; }) 515.Select(f => $"'{f}'").Aggregate((files, f) => $"{files}, {f}"); 663invalidNamespaces.Select(n => $"'{n.Key},{n.Value}'").Aggregate((msg, n) => $"{msg}, {n}"))); 735var inputFiles = Metadata.MetadataFileNameManager.ResolveFiles(metadataUri.LocalPath).Select(f => f.FullName); 1045.Select(o => $"{o.Name}:[{OptionValueParser.GetTelemetryValue(o)}]")
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (1)
1025matchedMethods = matchedMethods.Where(method => TypeSequenceEqual(method.GetParameters().Select(param => param.ParameterType).ToArray(), parameterTypes));
Metadata\MetadataDocumentLoader.cs (4)
107this.metadataSourceFiles.AddRange(fileInfoList.Select(fi => new Uri(fi.FullName, UriKind.Absolute))); 148this.metadataSourceFiles.AddRange(fileInfoList.Select(fi => new Uri(fi.FullName, UriKind.Absolute))); 578var documents = metadataSections.Select((s) => s.Metadata); 723var orderedFileNames = this.metadataSourceFiles.Select(u => u.ToString().ToUpperInvariant()).OrderBy(u => u);
Metadata\MetadataDocumentSaver.cs (3)
62MetadataFiles = metadataDocumentSaver.MetadataFiles.Select(mf => mf.FilePath), 63DocumentSaveErrors = metadataDocumentSaver.UnresolvedReferences.Distinct().OrderBy(ur => ur.Uri).Select(ur => string.Format(CultureInfo.CurrentCulture, MetadataResources.ErrUnableToResolveSchemaReferenceFormat, ur.Uri)) 281foreach (var wsdl in wsdlFiles.Select(f => f.Wsdl))
Metadata\ServiceDescriptor.cs (1)
242return this.metadataDocumentLoader.MetadataSections.Select((s) => s.Metadata).OfType<WsdlNS.ServiceDescription>().Any((wsdl) => ContainsHttpBindings(wsdl));
Shared\MSBuildProj.cs (2)
215foreach (var targetFx in targetFrameworks.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim())) 1007.Select(f => new FileInfo(f))
Shared\Options\ApplicationOptions.cs (1)
228}).Select(o => o.Value);
Shared\Options\ListValue.cs (1)
215var value = this.InnerList.Count > 0 ? this.InnerList.Select(i => $"\"{i}\"").Aggregate((str, s) => $"{str}, {s}") : string.Empty;
Shared\Options\ListValueOption.cs (1)
114collection = jToken.Select(i => i.Value<string>()).ToList();
Shared\Options\OptionValueParser.cs (1)
173value = list.Select(item => $"'{item}'").Aggregate((num, s) => num + ", " + s).ToString();
Shared\Options\WCFCSUpdateOptions.cs (1)
97foreach (var packageName in _deserializedCollectionAssemblies.Select(an => ProjectDependency.FromPackage(an, ProjectDependency.NetCoreAppPackageID, "*")))
Shared\ProjectPropertyResolver.cs (1)
207.Select(f => new FileInfo(f));
Shared\Utilities\RuntimeEnvironmentHelper.cs (1)
87.Select(e => e.Attribute("value").Value.TrimEnd(Path.DirectorySeparatorChar))
Tool.cs (2)
206new ServiceDescriptor(options.Inputs.Select(i => i.ToString()).ToList(), credsProvider, credsProvider, credsProvider); 324var ex = new AggregateException(options.Errors.Select(e => e as ToolArgumentException ?? new ToolArgumentException(e.Message, e.InnerException)));
dotnet-user-jwts (11)
Commands\CreateCommand.cs (1)
209optionsString += $"{Resources.JwtPrint_CustomClaims}: [{string.Join(", ", claims.Select(kvp => $"{kvp.Key}={kvp.Value}"))}]{Environment.NewLine}";
Helpers\ConsoleTable.cs (3)
51.Select((t, i) => _rows.Select(x => x[i]) 54.Select(x => x!.ToString()!.Length).Max()) 90.Select(i => " | {" + i + ", " + maxColumnLengths[i] + "}")
Helpers\DevJwtCliHelpers.cs (1)
178: string.Join(", ", jwt.CustomClaims.Select(kvp => $"{kvp.Key}={kvp.Value}"));
Helpers\JwtAuthenticationSchemeSettings.cs (1)
24[nameof(TokenValidationParameters.ValidAudiences)] = new JsonArray(Audiences.Select(aud => JsonValue.Create(aud)).ToArray()),
Helpers\JwtIssuer.cs (4)
36identity.AddClaims(scopesToAdd.Select(s => new Claim("scope", s))); 41identity.AddClaims(rolesToAdd.Select(r => new Claim(ClaimTypes.Role, r))); 46identity.AddClaims(claimsToAdd.Select(kvp => new Claim(kvp.Key, kvp.Value))); 55identity.AddClaims(audiences.Select(aud => new Claim(JwtRegisteredClaimNames.Aud, aud)));
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (1)
144var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
dotnet-user-secrets (1)
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (1)
144var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
FilesWebSite (1)
Controllers\UploadFilesController.cs (1)
35files.Add(keyValuePair.Key, keyValuePair.Value?.Select(formFile => formFile?.FileName).ToList());
FormatterWebSite (1)
ValidateBodyParameterAttribute.cs (1)
32Errors = parameterBindingErrors.Select(x => x.ErrorMessage).ToList(),
GetDocument.Insider (1)
ReporterExtensions.cs (1)
34.Select(l => prefix + l));
HealthChecksSample (2)
CustomWriterStartup.cs (2)
47new JProperty("results", new JObject(result.Entries.Select(pair => 51new JProperty("data", new JObject(pair.Value.Data.Select(p => new JProperty(p.Key, p.Value))))))))));
HostedBlazorWebassemblyApp.Server (1)
Data\WeatherForecastService.cs (1)
21return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
HtmlGenerationWebSite (1)
ProductsService.cs (1)
47return products.Select(p => p.ProductName);
HttpStress (5)
Program.cs (5)
371clientOperations = opIndices.Select(i => clientOperations[i]).ToArray(); 382Console.WriteLine(" Operations: " + string.Join(", ", clientOperations.Select(o => o.Item1))); 443new StringValues(Enumerable.Range(0, i).Select(id => "value" + id).ToArray())); 452new StringValues(Enumerable.Range(0, i).Select(id => "value" + id).ToArray())); 579Task.WaitAll(Enumerable.Range(0, concurrentRequests).Select(taskNum => Task.Run(async () =>
Identity.DefaultUI.WebSite (2)
src\Identity\test\InMemory.Test\InMemoryUserStore.cs (2)
35var claims = user.Claims.Select(c => new Claim(c.ClaimType, c.ClaimValue)).ToList(); 191.Select(l => new UserLoginInfo(l.LoginProvider, l.ProviderKey, l.ProviderDisplayName)).ToList();
IdentitySample.Mvc (1)
Controllers\AccountController.cs (1)
355var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList();
IIS.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
49=> from v in TestVariants.Select(v => v.Single())
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
93return string.Join(",", entries.Select(e => e.Message));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
194return dictionary.Keys.Select(k => new[] { k });
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
93return string.Join(",", entries.Select(e => e.Message));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
194return dictionary.Keys.Select(k => new[] { k });
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
93return string.Join(",", entries.Select(e => e.Message));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
194return dictionary.Keys.Select(k => new[] { k });
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
93return string.Join(",", entries.Select(e => e.Message));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
194return dictionary.Keys.Select(k => new[] { k });
IIS.ShadowCopy.Tests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
93return string.Join(",", entries.Select(e => e.Message));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
194return dictionary.Keys.Select(k => new[] { k });
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
49=> from v in TestVariants.Select(v => v.Single())
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
93return string.Join(",", entries.Select(e => e.Message));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
194return dictionary.Keys.Select(k => new[] { k });
illink (6)
ILLink.CodeFixProvider (1)
UnconditionalSuppressMessageCodeFixProvider.cs (1)
30 DiagnosticId.RequiresDynamicCode }).Select (d => d.AsString ()).ToImmutableArray ();
ILLink.RoslynAnalyzer (4)
src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
66 return string.Join (", ", memberTypesList.Select (mt => {
src\tools\illink\src\ILLink.Shared\DataFlow\ValueSet.cs (2)
284 sb.Append (string.Join (",", GetKnownValues ().Select (v => v.ToString ()))); 307 return new ValueSet<TValue> (GetKnownValues ().Select (value => value is IDeepCopyValue<TValue> copyValue ? copyValue.DeepCopy () : value));
src\tools\illink\src\ILLink.Shared\TrimAnalysis\ArrayValue.cs (1)
45 return new(input.AsEnumerable ().Select (v => v is ArrayValue ? UnknownValue.Instance : v));
ILLink.Tasks (1)
CreateRuntimeRootDescriptorFile.cs (1)
312 foreach ((var fs, var members) in featureSwitchMembers.Select (kv => (kv.Key, kv.Value))) {
Infrastructure.Common (3)
xunit\WcfTestDiscoverer.cs (3)
49return testCases.Select(tc => new WcfTestCase((XunitTestCase)tc, 78return testCases.Select(tc => new WcfTestCase((XunitTestCase)tc, 110return testCases.Select(tc => new WcfTestCase(testCase: (XunitTestCase)tc,
InMemory.FunctionalTests (7)
Http2\Http2TestBase.cs (2)
778return Task.WhenAll(_runningStreams.Values.Select(tcs => tcs.Task)).DefaultTimeout(); 985.ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray()));
RequestHeaderLimitsTests.cs (1)
158.Select(i => $"Header-{i}: value{i}\r\n")));
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
179var args = string.Join(".", protocols.Select(p => ProtocolToString(p)));
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
715.ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray()));
src\Servers\Kestrel\shared\test\HttpParsingData.cs (1)
238}.Concat(MethodWithNonTokenCharData.Select(method => $"{method} / HTTP/1.0\r\n"));
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
60AddEndpoints(startingPort, unavailableEndpoints, properties.GetActiveTcpConnections().Select(c => c.LocalEndPoint));
installer.tasks (15)
GenerateFileVersionProps.cs (2)
110.Select(p => p.Value.File.ItemSpec) 117string.Concat(versionlessFiles.Select(f => Environment.NewLine + f)));
GenerateTestSharedFrameworkDepsFile.cs (3)
67runtimeAssemblyGroups: new[] { new RuntimeAssetGroup(string.Empty, managedFileNames.Select(f => $"runtimes/{rid}/lib/{tfm}/{f}")) }, 68nativeLibraryGroups: new[] { new RuntimeAssetGroup(string.Empty, nativeFileNames.Select(f => $"runtimes/{rid}/native/{f}")) }, 118foreach (string rid in runtimeGraph.Runtimes.Select(p => p.Key))
RegenerateDownloadTable.cs (4)
67.Select(line => line.Substring( 72string[] rows = Platforms.Select(p => CreateRow(p, links)).ToArray(); 78$"| Platform |{string.Concat(Branches.Select(p => $" {p.ItemSpec} |"))}", 120Branches.Select(branch => $" {CreateCell(platform, branch, links)} |"));
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (4)
58return PotentialTpnPaths.Select(path => new 66.Select(async c => 143.Select(r => r.Content) 172.Select(r => r.Url)) +
StaticFileRegeneration\TpnSectionHeader.cs (2)
97.Select(s => s.Trim()) 136.Select(s => s.Trim())
InteractiveHost.UnitTests (1)
AbstractInteractiveHostTests.cs (1)
210=> paths.Length == 0 ? "SearchPaths { }" : $"SearchPaths {{ {string.Join(", ", paths.Select(p => "\"" + p.Replace("\\", "\\\\") + "\""))} }}";
Interop.FunctionalTests (6)
Http2\Http2RequestTests.cs (1)
233var randomBytes = Enumerable.Range(1, DataLength).Select(i => (byte)((i % 10) + 48)).ToArray();
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
60AddEndpoints(startingPort, unavailableEndpoints, properties.GetActiveTcpConnections().Select(c => c.LocalEndPoint));
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (2)
25.Select(u => u.Port); 31.Select(a => new Uri(a));
src\Servers\Kestrel\shared\test\TransportTestHelpers\IWebHostPortExtensions.cs (2)
21.Select(u => u.Port); 27.Select(a => new Uri(a));
InteropClient (5)
InteropClient.cs (5)
311var bodySizes = new List<int> { 27182, 8, 1828, 45904 }.Select((size) => new StreamingInputCallRequest { Payload = CreateZerosPayload(size) }); 331ResponseParameters = { bodySizes.Select((size) => new ResponseParameters { Size = size }) } 337CollectionAssert.AreEqual(bodySizes, responseList.Select((item) => item.Payload.Body.Length).ToList()); 827ResponseParameters = { bodySizes.Select((size) => new ResponseParameters { Size = size, Compressed = new BoolValue { Value = true } }) } 834CollectionAssert.AreEqual(bodySizes, responseList.Select((item) => item.Payload.Body.Length).ToList());
IOperationGenerator (6)
IOperationClassWriter.cs (5)
226return node.OperationKind.Entries.Select(entry => entry.Name); 315.SelectMany(n => n.OperationKind!.Entries.Select(e => (entry: e, node: n))) 317.ToDictionary(g => g.Key, g => g.Select(k => (entryName: k.entry, k.node))); 330var unusedKinds = _tree.UnusedOperationKinds.Entries?.Select(e => e.Value).ToList() ?? new List<int>(); 1120private static List<string> GetPropertyOrder(Node node) => node.ChildrenOrder?.Split(",", StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToList() ?? new List<string>();
IOperationClassWriter.Verifier.cs (1)
86var properties = GetAllGeneratedIOperationProperties(node).Where(p => !p.IsInternal).Select(p => p.Name).ToList();
Keycloak.ApiService (1)
Program.cs (1)
30var forecast = Enumerable.Range(1, 5).Select(index =>
Microsoft.Analyzers.Extra (1)
AsyncMethodWithoutCancellation.cs (1)
144.Select(interfaceSymbol => containingType.FindImplementationForInterfaceMember(interfaceSymbol))
Microsoft.Analyzers.Extra.Tests (1)
Resources\AnalyzerOptionsFactory.cs (1)
16var files = fileNames.Select(name => (AdditionalText)new FileVisibleToAnalyzer(name)).ToArray();
Microsoft.Analyzers.Local (3)
ApiLifecycle\Utils.cs (2)
28? substrings[1].Split(_comma).Select(x => x.Trim()).ToArray() 29: substrings[2].Split(_comma).Select(x => x.Trim()).ToArray();
InternalReferencedInPublicDocAnalyzer.cs (1)
43.Select(trivia => trivia.GetStructure())
Microsoft.Analyzers.Local.Tests (1)
Resources\AnalyzerOptionsFactory.cs (1)
16var files = fileNames.Select(name => (AdditionalText)new FileVisibleToAnalyzer(name)).ToArray();
Microsoft.Arcade.Common (4)
ArgumentEscaper.cs (2)
17return string.Join(" ", args.Select(EscapeArg)); 32return string.Join(" ", args.Select(EscapeArgForCmd));
MSBuildTaskBase.cs (2)
70return GetType().GetMethod(ExecuteMethodName).GetParameters().Select(p => p.ParameterType).ToArray(); 81return GetExecuteParameterTypes().Select(t => serviceProvider.GetRequiredService(t)).ToArray();
Microsoft.Arcade.Test.Common (3)
AssertEx.cs (3)
304return string.Join(separator, list.Select(itemInspector)); 465message.AppendLine(string.Join(itemSeparator, actual.Select(itemInspector))); 469message.AppendLine(string.Join(itemSeparator, expected.Select(itemInspector)));
Microsoft.AspNetCore.Analyzers.Test (1)
ConfigureMethodVisitorTest.cs (1)
86.Select(m => m.ContainingType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + "." + m.Name)
Microsoft.AspNetCore.Antiforgery.Test (7)
DefaultAntiforgeryTest.cs (7)
385.Select(wc => wc.State?.ToString()) 403.Select(wc => wc.State?.ToString()) 421.Select(wc => wc.State?.ToString()) 439.Select(wc => wc.State?.ToString()) 1301.Select(wc => wc.State?.ToString()) 1340.Select(wc => wc.State?.ToString()) 1374.Select(wc => wc.State?.ToString())
Microsoft.AspNetCore.App.Analyzers (2)
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentDetector.cs (1)
48options = optionGroup.Captures.OfType<Capture>().Select(c => c.Value);
RouteHandlers\DetectAmbiguousRoutes.cs (1)
30.Select(kvp => new { MapOperation = kvp.Key, ResolvedOperation = ResolveOperation(kvp.Key.Operation, wellKnownTypes) })
Microsoft.AspNetCore.App.Analyzers.Test (4)
Http\HeaderDictionaryIndexerAnalyzerTests.cs (1)
166.Select(p => p.Name)
RouteEmbeddedLanguage\Infrastructure\FormattedClassification.cs (2)
45var type = string.Join("", parts.Select(Capitalize)); 53var type = string.Join("", parts.Select(Capitalize));
RouteEmbeddedLanguage\RoutePatternClassifierTests.cs (1)
33var actualFormatted = actualOrdered.Select(a => new FormattedClassification(rewrittenCode.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType)).ToArray();
Microsoft.AspNetCore.App.UnitTests (14)
SharedFxTests.cs (6)
38.Select(Path.GetFileNameWithoutExtension) 62.Select(Path.GetFileNameWithoutExtension) 272_output.WriteLine(string.Join('\n', runtimeListEntries.Select(i => i.Attribute("Path").Value).OrderBy(i => i))); 277.Select(i => 334.Select(i => i.FullName).ToHashSet(); 336var expectedPaths = runtimeListEntries.Select(i => i.Attribute("Path").Value).ToHashSet();
TargetingPackTests.cs (8)
39.Select(Path.GetFileNameWithoutExtension) 229.Select(i => 249.Select(i => 307.Select(p => Path.GetFileNameWithoutExtension(p)) 318_output.WriteLine(string.Join('\n', actualElements.Select(i => i.Attribute("AssemblyName").Value).OrderBy(i => i))); 323.Select(i => 376.Select(i => i.FullName).ToHashSet(); 378var expectedPaths = frameworkListEntries.Select(i => i.Attribute("Path").Value).ToHashSet();
Microsoft.AspNetCore.Authentication.Core (3)
AuthenticationService.cs (3)
241var schemes = string.Join(", ", (await Schemes.GetAllSchemesAsync()).Select(sch => sch.Name)); 259.Select(sch => sch.Name)); 299.Select(sch => sch.Name));
Microsoft.AspNetCore.Authentication.JwtBearer (2)
JwtBearerConfigureOptions.cs (2)
45var issuers = configSection.GetSection(nameof(TokenValidationParameters.ValidIssuers)).GetChildren().Select(iss => iss.Value).ToList(); 48var audiences = configSection.GetSection(nameof(TokenValidationParameters.ValidAudiences)).GetChildren().Select(aud => aud.Value).ToList();
Microsoft.AspNetCore.Authentication.Negotiate (1)
Internal\LdapAdapter.cs (1)
41var distinguishedName = settings.Domain.Split('.').Select(name => $"dc={name}").Aggregate((a, b) => $"{a},{b}");
Microsoft.AspNetCore.Authentication.OpenIdConnect (6)
OpenIdConnectConfigureOptions.cs (1)
112var elementsFromConfig = listConfigSection.GetChildren().Select(element => element.Value).OfType<string>();
OpenIdConnectHandler.cs (5)
112message = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 127message = new OpenIdConnectMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 316var message = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 643authorizationResponse = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 670authorizationResponse = new OpenIdConnectMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
Microsoft.AspNetCore.Authentication.Test (7)
BearerTokenTests.cs (1)
18return services.Select(d => d.ServiceType).Single(typeof(AuthenticationHandler<BearerTokenOptions>).IsAssignableFrom);
CookieTests.cs (2)
1893xml.Add(result.Ticket.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value)))); 1897xml.Add(result.Ticket.Properties.Items.Select(extra => new XElement("extra", new XAttribute("type", extra.Key), new XAttribute("value", extra.Value))));
OpenIdConnect\OpenIdConnectTests.cs (2)
243.Select(each => each.Split('=')) 274.Select(each => each.Split('='))
OpenIdConnect\TestSettings.cs (1)
141redirectUri.Query.TrimStart('?').Split('&').Select(part => part.Split('=')).ToDictionary(parts => parts[0], parts => parts[1]);
TestExtensions.cs (1)
54xml.Add(identity.Claims.Select(claim =>
Microsoft.AspNetCore.Authentication.WsFederation (2)
WsFederationHandler.cs (2)
164wsFederationMessage = new WsFederationMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 474var message = new WsFederationMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
Microsoft.AspNetCore.Authorization (1)
AuthorizationPolicy.cs (1)
155var trimmedRolesSplit = rolesSplit.Where(r => !string.IsNullOrWhiteSpace(r)).Select(r => r.Trim());
Microsoft.AspNetCore.Authorization.Policy (1)
AuthorizationEndpointConventionBuilderExtensions.cs (1)
46return builder.RequireAuthorization(policyNames.Select(n => new AuthorizeAttribute(n)).ToArray());
Microsoft.AspNetCore.BrowserTesting (1)
BrowserManagerConfiguration.cs (1)
299true => configuration.Get<Dictionary<string, bool>>().Where(kvp => kvp.Value == true).Select(kvp => kvp.Key).ToArray()
Microsoft.AspNetCore.Components (3)
src\Http\Routing\src\Patterns\RoutePattern.cs (1)
163return RawText ?? string.Join(SeparatorString, PathSegments.Select(s => s.DebuggerToString()));
src\Http\Routing\src\Patterns\RoutePatternPathSegment.cs (1)
49return string.Join(string.Empty, parts.Select(p => p.DebuggerToString()));
src\Http\Routing\src\Tree\UrlMatchingNode.cs (1)
86return $"Length: {Depth}, Matches: {string.Join(" | ", Matches?.Select(m => $"({m.TemplateMatcher.RoutePattern.RawText})"))}";
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParameterAnalyzer.cs (1)
133captureUnmatchedValuesParameters.Select(p => p.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat)).OrderBy(n => n))));
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Verifiers\CodeFixVerifier.cs (1)
116string.Join("\r\n", newCompilerDiagnostics.Select(d => d.ToString())),
Microsoft.AspNetCore.Components.Authorization.Tests (2)
AuthorizeRouteViewTest.cs (2)
287.Select(f => f.Component); 316.Select(f => f.Component);
Microsoft.AspNetCore.Components.Endpoints (1)
Discovery\IRazorComponentApplication.cs (1)
36RouteTemplates = routes.Select(r => r.Template).ToList(),
Microsoft.AspNetCore.Components.Endpoints.Tests (8)
Binding\FormDataMapperTests.cs (5)
432.Select(i => new KeyValuePair<string, StringValues>( 463.Select(i => new KeyValuePair<string, StringValues>( 509.Select(i => new KeyValuePair<string, StringValues>( 570.Select(i => new KeyValuePair<string, StringValues>( 1067.Select(i => new KeyValuePair<string, StringValues>(
RazorComponentsServiceCollectionExtensionsTest.cs (3)
81.Select(sd => sd.ServiceType); 121.Select(service => service switch 135Assert.Fail($"Found duplicate implementation types for {serviceType}. Implementation types: {string.Join(", ", implementationTypes.Select(x => x.ToString()))}");
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParameterAnalyzer.cs (1)
120captureUnmatchedValuesParameters.Select(p => p.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat)).OrderBy(n => n))));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Verifiers\CodeFixVerifier.cs (1)
116string.Join("\r\n", newCompilerDiagnostics.Select(d => d.ToString())),
Microsoft.AspNetCore.Components.Server (1)
Circuits\RemoteRenderer.cs (1)
199return Task.WhenAll(_unacknowledgedRenderBatches.Select(WriteBatchBytesAsync));
Microsoft.AspNetCore.Components.Server.Tests (6)
Circuits\CircuitHostTest.cs (1)
805await Task.WhenAll(_renderTcsArray.Select(tcs => tcs.Task));
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (3)
348public static IEnumerable<object[]> BaseInvalidPayloadNames => BaseInvalidPayloads.Keys.Select(name => new object[] { name }); 386public static IEnumerable<object[]> ArgumentBindingErrorNames => ArgumentBindingErrors.Keys.Select(name => new object[] { name }); 436public static IEnumerable<object[]> MessageSizeDataNames => MessageSizeData.Keys.Select(name => new object[] { name });
src\SignalR\common\SignalR.Common\test\Internal\Protocol\TestBinder.cs (2)
21_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray(); 24_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray();
Microsoft.AspNetCore.Components.Tests (15)
CascadingParameterTest.cs (1)
845var components = Enumerable.Range(0, numSubscribers).Select(_ => new SimpleSubscriberComponent()).ToArray();
RendererTest.cs (11)
2241.Select(edit => batch.ReferenceFrames[edit.ReferenceFrameIndex]) 2243.Select(frame => frame.ComponentId) 2643.Select(e => batch.ReferenceFrames[e.ReferenceFrameIndex]) 2770.Select(e => batch.ReferenceFrames[e.ReferenceFrameIndex]) 3422.Select( 4564Assert.Collection(componentFrames.Select(f => (TestErrorBoundary)f.Component), 4590.Select(f => (TestErrorBoundary)f.Component); 4627.Select(f => (TestErrorBoundary)f.Component).ToArray(); 4665.Select(f => (TestErrorBoundary)f.Component); 4704.Select(f => (TestErrorBoundary)f.Component); 4753.Select(f => (TestErrorBoundary)f.Component);
RenderTreeDiffBuilderTest.cs (2)
68}.Select(x => new object[] { x }); 2439.Select(x => (T)x.Component)
Routing\RouteTableFactoryTests.cs (1)
1143.ToDictionary(group => group.Key, group => group.Select(g => g.Template).ToArray());
Microsoft.AspNetCore.Components.Web.Tests (3)
Forms\EditFormTest.cs (1)
210.Select(f => f.Component)
Forms\InputRadioTest.cs (1)
108.Select(f => f.Component)
Forms\InputRenderer.cs (1)
23.Select(f => f.Component)
Microsoft.AspNetCore.Components.WebAssembly (1)
Services\LazyAssemblyLoader.cs (1)
73var pendingLoads = newAssembliesToLoad.Select(LazyAssemblyLoaderInterop.LoadLazyAssembly);
Microsoft.AspNetCore.Components.WebView.Test (2)
StaticContentProviderTests.cs (2)
64.Select(x => new InMemoryFileInfo(x.Key, x.Value)) 92.Select(x => new InMemoryFileInfo(x.Key, x.Value))
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
393 string.Join(Environment.NewLine, headers.Select(kvp => $"{kvp.Key}: {kvp.Value}"));
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
393 string.Join(Environment.NewLine, headers.Select(kvp => $"{kvp.Key}: {kvp.Value}"));
Microsoft.AspNetCore.Cors (1)
Infrastructure\CorsPolicyExtensions.cs (1)
23.Select(CreateDomainUri)
Microsoft.AspNetCore.DataProtection (2)
KeyManagement\KeyRingBasedDataProtector.cs (1)
73return "(" + String.Join(", ", purposes.Select(p => "'" + p + "'")) + ")";
KeyManagement\XmlKeyManager.cs (1)
434var allElements = deletableElements.Select(d => d.Element).ToArray();
Microsoft.AspNetCore.DataProtection.Tests (7)
Internal\KeyManagementOptionsSetupTest.cs (1)
49["KeyEscrowSinks"] = String.Join(" ;; ; ", new Type[] { typeof(MyKeyEscrowSink1), typeof(MyKeyEscrowSink2) }.Select(t => t.AssemblyQualifiedName)),
RegistryPolicyResolverTests.cs (1)
39["KeyEscrowSinks"] = String.Join(" ;; ; ", new Type[] { typeof(MyKeyEscrowSink1), typeof(MyKeyEscrowSink2) }.Select(t => t.AssemblyQualifiedName))
Repositories\EphemeralXmlRepositoryTests.cs (1)
78var elementSet = new HashSet<string>(repository.GetAllElements().Select(e => e.Name.LocalName));
Repositories\FileSystemXmlRepositoryTests.cs (2)
136var orderedNames = allElements.Select(el => el.Name.LocalName).OrderBy(name => name); 183var elementSet = new HashSet<string>(repository.GetAllElements().Select(e => e.Name.LocalName));
Repositories\RegistryXmlRepositoryTests.cs (2)
123var orderedNames = allElements.Select(el => el.Name.LocalName).OrderBy(name => name); 171var elementSet = new HashSet<string>(repository.GetAllElements().Select(e => e.Name.LocalName));
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
299var hashes = matches.OfType<Match>().Select(m => m.Groups[1].Value).ToList();
Microsoft.AspNetCore.Diagnostics (6)
src\Shared\Diagnostics\BaseView.cs (1)
296.Select(HtmlEncoder.Encode));
src\Shared\RazorViews\BaseView.cs (1)
286.Select(HtmlEncoder.Encode));
src\Shared\StackTrace\ExceptionDetails\ExceptionDetailsProvider.cs (1)
42.Select(frame => GetStackFrameSourceCodeInfo(
src\Shared\StackTrace\StackFrame\MethodDisplayInfo.cs (1)
47builder.AppendJoin(", ", Parameters.Select(p => p.ToString()));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
110.Select(arg => TypeNameHelper.GetTypeDisplayName(arg, fullName: false, includeGenericParameterNames: true))) + ">"; 114var parameters = method.GetParameters().Select(parameter =>
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (4)
DatabaseDeveloperPageExceptionFilter.cs (1)
60.Select(o => o.ContextType)
MigrationsEndPointMiddleware.cs (1)
111.Select(o => o.ContextType);
src\Shared\Diagnostics\BaseView.cs (1)
296.Select(HtmlEncoder.Encode));
src\Shared\RazorViews\BaseView.cs (1)
286.Select(HtmlEncoder.Encode));
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckOptions.cs (1)
55var missing = string.Join(", ", missingHealthStatus.Select(status => $"{nameof(HealthStatus)}.{status}"));
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionDetailsProviderTest.cs (1)
276return Enumerable.Range(start, count).Select(i => string.Format(CultureInfo.InvariantCulture, "Line{0}", i));
Microsoft.AspNetCore.Grpc.JsonTranscoding (6)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
242return string.Join(",", paths.Select(ToJsonName));
src\Grpc\JsonTranscoding\src\Shared\Server\InterceptorPipelineBuilder.cs (1)
35_interceptors = interceptors.Select(i => new InterceptorActivatorHandle(i)).ToList();
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (4)
400var completeFieldPath = string.Join(".", fieldDescriptors.Select(d => d.Name)); 401var completeJsonPath = string.Join(".", fieldDescriptors.Select(d => d.JsonName)); 542var joinedPath = string.Join(".", path.Select(d => d.JsonName)); 552var joinedPath = string.Join(".", path.Select(d => d.JsonName));
Microsoft.AspNetCore.Grpc.Swagger (7)
Internal\XmlComments\GrpcXmlCommentsDocumentFilter.cs (2)
30.Select(apiDesc => apiDesc.ActionDescriptor) 33.Select(group => new KeyValuePair<string, ActionDescriptor>(group.Key, group.First()));
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
242return string.Join(",", paths.Select(ToJsonName));
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (4)
400var completeFieldPath = string.Join(".", fieldDescriptors.Select(d => d.Name)); 401var completeJsonPath = string.Join(".", fieldDescriptors.Select(d => d.JsonName)); 542var joinedPath = string.Join(".", path.Select(d => d.JsonName)); 552var joinedPath = string.Join(".", path.Select(d => d.JsonName));
Microsoft.AspNetCore.Grpc.Swagger.Tests (3)
Binding\ResponseBodyTests.cs (1)
67var enumValues = enumSchema.Enum.Select(e => ((OpenApiString)e).Value).OrderBy(s => s).ToList();
SchemaGeneratorIntegrationTests.cs (2)
47var enumValues = enumSchema.Enum.Select(e => ((OpenApiString)e).Value).OrderBy(s => s).ToList(); 67var enumValues = schema.Enum.Select(e => ((OpenApiString)e).Value).OrderBy(s => s).ToList();
Microsoft.AspNetCore.Hosting (6)
GenericHost\GenericWebHostService.cs (1)
88.Select(port => $"{scheme}://*:{port}"));
src\Shared\RazorViews\BaseView.cs (1)
286.Select(HtmlEncoder.Encode));
src\Shared\StackTrace\ExceptionDetails\ExceptionDetailsProvider.cs (1)
42.Select(frame => GetStackFrameSourceCodeInfo(
src\Shared\StackTrace\StackFrame\MethodDisplayInfo.cs (1)
47builder.AppendJoin(", ", Parameters.Select(p => p.ToString()));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
110.Select(arg => TypeNameHelper.GetTypeDisplayName(arg, fullName: false, includeGenericParameterNames: true))) + ">"; 114var parameters = method.GetParameters().Select(parameter =>
Microsoft.AspNetCore.Hosting.Tests (4)
StaticWebAssets\ManifestStaticWebAssetsFileProviderTests.cs (4)
439Assert.Equal(new[] { (true, "_content") }, contents.Select(e => (e.IsDirectory, e.Name)).OrderBy(e => e.Name).ToArray()); 472contents.Select(e => (e.IsDirectory, e.Name)).OrderBy(e => e.Name).ToArray()); 490contents.Select(e => (e.IsDirectory, e.Name)).OrderBy(e => e.Name).ToArray()); 606contents.Select(e => (e.IsDirectory, e.Name)).OrderBy(e => e.Name).ToArray());
Microsoft.AspNetCore.Http (1)
Internal\RequestCookieCollection.cs (1)
235public DictionaryItemDebugView<string, string>[] Items => _collection.Select(pair => new DictionaryItemDebugView<string, string>(pair)).ToArray();
Microsoft.AspNetCore.Http.Abstractions (2)
Internal\ParsingHelpers.cs (2)
60headers[key] = string.Join(',', value.Select(QuoteIfNeeded)); 119headers[key] = existing + "," + string.Join(',', values.Select(QuoteIfNeeded));
Microsoft.AspNetCore.Http.Connections.Tests (1)
NegotiateProtocolTests.cs (1)
43var responseTransports = response.AvailableTransports.Select(t => t.Transport).ToList();
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (1)
41BindAsyncUriTypesAndOptionalitySupport.Select(x => new[] { x[0] });
Microsoft.AspNetCore.Http.RequestDelegateGenerator (7)
RequestDelegateGenerator.cs (1)
165.Select(endpoint => endpoint.EmitterContext.HttpMethod!)
StaticRouteHandlerModel\Emitters\EndpointEmitter.cs (1)
134public static string EmitArgumentList(this Endpoint endpoint) => string.Join(", ", endpoint.Parameters.Select(p => p.EmitArgument()));
StaticRouteHandlerModel\EndpointParameter.cs (5)
179EndpointParameters = matchedProperties.Select(matchedParameter => new EndpointParameter(endpoint, matchedParameter.Property, matchedParameter.Parameter, wellKnownTypes)); 182var parameterList = string.Join(", ", EndpointParameters.Select(p => $"{p.SymbolName} = {p.EmitHandlerArgument()}")); 187var parameterList = string.Join(", ", EndpointParameters.Select(p => p.EmitHandlerArgument())); 491matchedProperties = writableProperties.Select(property => new ConstructorParameter(property, null)); 517matchedProperties = writableProperties.Select(property => new ConstructorParameter(property, null));
Microsoft.AspNetCore.Http.Results.Tests (5)
ResultsTests.cs (3)
1709var testedMethods = new HashSet<string>(FactoryMethodsTuples.Select(t => GetMemberName(t.Item1.Body))); 1712.Select(m => m.Name)); 1783public static IEnumerable<object[]> FactoryMethodsFromTuples() => FactoryMethodsTuples.Select(t => new object[] { t.Item1, t.Item2 });
src\Shared\ResultsTests\FileStreamResultTestBase.cs (2)
378.Select(b => (byte)(b % 20)).ToArray(); 403.Select(b => (byte)(b % 20)).ToArray();
Microsoft.AspNetCore.Http.Tests (1)
RequestCookiesCollectionTests.cs (1)
62foreach (var c in Enumerable.Range(0x00, 0xFF).Select(x => (char)x))
Microsoft.AspNetCore.HttpLogging.Tests (6)
FileLoggerProcessorTests.cs (6)
187.Select(f => f.Name) 310.Select(f => f.Name) 334.Select(f => f.Name) 394.Select(f => f.Name) 460.Select(f => f.Name) 530.Select(f => f.Name)
Microsoft.AspNetCore.HttpOverrides.Tests (1)
ForwardedHeadersMiddlewareTest.cs (1)
231foreach (var ip in knownIPs.Split(',').Select(text => IPAddress.Parse(text)))
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (2)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
48.Select(method => method.DeclaringType.Name + "." + method.Name)
src\Identity\test\Shared\PriorityOrderer.cs (1)
60foreach (var list in sortedMethods.Keys.Select(priority => sortedMethods[priority]))
Microsoft.AspNetCore.Identity.FunctionalTests (6)
MapIdentityApiTests.cs (5)
747var recoveryCodes = enable2faContent.GetProperty("recoveryCodes").EnumerateArray().Select(e => e.GetString()).ToArray(); 844var recoveryCodes = enable2faContent.GetProperty("recoveryCodes").EnumerateArray().Select(e => e.GetString()).ToArray(); 875var resetRecoveryCodes = resetRecoveryContent.GetProperty("recoveryCodes").EnumerateArray().Select(e => e.GetString()).ToArray(); 1307authGroup.MapGet("/claims", (ClaimsPrincipal user) => user.Claims.Select(c => new { c.Type, c.Value })); 1353public static object[][] AddIdentityModes => AddIdentityActions.Keys.Select(key => new object[] { key }).ToArray();
Pages\Account\Manage\ShowRecoveryCodes.cs (1)
20public IEnumerable<string> Codes => _recoveryCodeElements.Select(rc => rc.TextContent);
Microsoft.AspNetCore.Identity.InMemory.Test (8)
FunctionalTest.cs (2)
412xml.Add(result.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value)))); 416xml.Add(result.Properties.Items.Select(extra => new XElement("extra", new XAttribute("type", extra.Key), new XAttribute("value", extra.Value))));
InMemoryStore.cs (2)
43foreach (var r in user.Roles.Select(ur => ur.RoleId)) 128var claims = role.Claims.Select(c => new Claim(c.ClaimType, c.ClaimValue)).ToList();
InMemoryUserStore.cs (2)
35var claims = user.Claims.Select(c => new Claim(c.ClaimType, c.ClaimValue)).ToList(); 191.Select(l => new UserLoginInfo(l.LoginProvider, l.ProviderKey, l.ProviderDisplayName)).ToList();
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
48.Select(method => method.DeclaringType.Name + "." + method.Name)
src\Identity\test\Shared\PriorityOrderer.cs (1)
60foreach (var list in sortedMethods.Keys.Select(priority => sortedMethods[priority]))
Microsoft.AspNetCore.Identity.Test (4)
IdentityUIScriptsTest.cs (2)
32.Select(st => new object[] { st }); 76.Select(st => new object[] { st });
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
48.Select(method => method.DeclaringType.Name + "." + method.Name)
src\Identity\test\Shared\PriorityOrderer.cs (1)
60foreach (var list in sortedMethods.Keys.Select(priority => sortedMethods[priority]))
Microsoft.AspNetCore.Identity.UI (1)
IdentityBuilderUIExtensions.cs (1)
97var enumValues = string.Join(", ", Enum.GetNames(typeof(UIFramework)).Select(v => $"'{v}'"));
Microsoft.AspNetCore.InternalTesting (5)
Logging\LogValuesAssert.cs (1)
56return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]"));
Tracing\EventAssert.cs (3)
30asserts.Select(a => a.CreateAsserter()).ToArray()); 59Assert.Collection(evt.PayloadNames, _payloadAsserters.Select(CreateNameAsserter).ToArray()); 60Assert.Collection(evt.Payload, _payloadAsserters.Select(t => t.asserter).ToArray());
xunit\TestMethodExtensions.cs (1)
21.Select(attributeInfo => attributeInfo.Attribute);
Microsoft.AspNetCore.InternalTesting.Tests (2)
AssemblyTestLogTests.cs (1)
393.Select(line =>
LogValuesAssertTest.cs (1)
218string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]"));
Microsoft.AspNetCore.Localization (1)
AcceptLanguageHeaderRequestCultureProvider.cs (1)
44.Select(x => x.Value).ToList();
Microsoft.AspNetCore.Localization.Tests (2)
RequestLocalizationOptionsTest.cs (2)
96Assert.Equal(supportedCultures, options.SupportedCultures.Select(c => c.Name)); 110Assert.Equal(supportedUICultures, options.SupportedUICultures.Select(c => c.Name));
Microsoft.AspNetCore.Mvc.Abstractions (3)
ModelBinding\BindingInfo.cs (1)
285.Select(p => p.PropertyFilter)
ModelBinding\CompositeBindingSource.cs (1)
56var id = string.Join('&', bindingSources.Select(s => s.Id).OrderBy(s => s, StringComparer.Ordinal));
ModelBinding\ModelStateDictionary.cs (1)
1264public DictionaryItemDebugView<string, ModelStateEntry?>[] Items => _dictionary.Select(pair => new DictionaryItemDebugView<string, ModelStateEntry?>(pair)).ToArray();
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
116var declaredUsings = new HashSet<string>(compilationUnit.Usings.Select(x => x.Name.ToString()));
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
ApiDescriptionGroupCollectionProvider.cs (1)
79.Select(g => new ApiDescriptionGroup(g.Key, g.ToArray()))
ApiResponseTypeProvider.cs (1)
70.Select(fd => fd.Filter)
DefaultApiDescriptionProvider.cs (1)
494.Select(fd => fd.Filter)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (4)
ApiResponseTypeProviderTest.cs (1)
781.Select(format => format.MediaType);
DefaultApiDescriptionProviderTest.cs (1)
2349.Select(responseType => responseType.MediaType);
EndpointMetadataApiDescriptionProviderTest.cs (2)
200Assert.Equal(["application/json", "application/custom"], inferredResponseType.ApiResponseFormats.Select(f => f.MediaType)); 1520.Select(format => format.MediaType);
Microsoft.AspNetCore.Mvc.Core (29)
AcceptVerbsAttribute.cs (1)
36_httpMethods = methods.Select(method => method.ToUpperInvariant()).ToList();
ApplicationModels\ActionAttributeRouteModel.cs (1)
147.Select(sm => sm.AttributeRouteModel)
ApplicationModels\ActionModel.cs (2)
66Parameters = new List<ParameterModel>(other.Parameters.Select(p => new ParameterModel(p) { Action = this })); 67Selectors = new List<SelectorModel>(other.Selectors.Select(s => new SelectorModel(s)));
ApplicationModels\ApplicationModelFactory.cs (1)
240var descriptions = actions.Select(a =>
ApplicationModels\ControllerActionDescriptorBuilder.cs (4)
58.Select(CreateParameterDescriptor) 174actionFilters.Select(f => new FilterDescriptor(f, FilterScope.Action)) 175.Concat(controllerFilters.Select(f => new FilterDescriptor(f, FilterScope.Controller))) 176.Concat(globalFilters.Select(f => new FilterDescriptor(f, FilterScope.Global)))
ApplicationModels\ControllerModel.cs (3)
64Actions = new List<ActionModel>(other.Actions.Select(a => new ActionModel(a) { Controller = this })); 67new List<PropertyModel>(other.ControllerProperties.Select(p => new PropertyModel(p) { Controller = this })); 68Selectors = new List<SelectorModel>(other.Selectors.Select(s => new SelectorModel(s)));
ApplicationModels\InferParameterBindingInfoConvention.cs (1)
95var parameters = string.Join(Environment.NewLine, fromBodyParameters.Select(p => p.DisplayName));
ApplicationParts\ApplicationPartManager.cs (1)
82.Select(name => Assembly.Load(name.AssemblyName))
DependencyInjection\MvcCoreMvcBuilderExtensions.cs (1)
127foreach (var controller in feature.Controllers.Select(c => c.AsType()))
DependencyInjection\MvcCoreMvcCoreBuilderExtensions.cs (1)
144foreach (var controller in feature.Controllers.Select(c => c.AsType()))
Infrastructure\ActionSelector.cs (1)
100finalMatches.Select(a => a.DisplayName));
ModelBinding\Binders\CollectionModelBinder.cs (1)
339.Select(i => i.ToString(CultureInfo.InvariantCulture));
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (1)
182.Select(p => p.PropertyFilter)
MvcCoreLoggerExtensions.cs (1)
94.Select(pair => pair.Key + "=" + Convert.ToString(pair.Value, CultureInfo.InvariantCulture))
Routing\ActionConstraintMatcherPolicy.cs (1)
196Candidates = items.Select(i => i.candidate).ToArray()
Routing\ActionEndpointFactory.cs (2)
141var formattedRouteKeys = string.Join(", ", resolvedRouteValues.Keys.Select(k => $"'{k}'")); 403foreach (var filter in action.FilterDescriptors.OrderBy(f => f, FilterDescriptorOrderComparer.Comparer).Select(f => f.Filter))
Routing\AttributeRoute.cs (1)
165errors.Select(
Routing\DynamicControllerEndpointMatcherPolicy.cs (1)
123"{ " + string.Join(", ", dynamicValues.Select(kvp => $"{kvp.Key}: {kvp.Value}")) + " }.");
SerializableError.cs (1)
44var errorMessages = errors.Select(error =>
src\Shared\PropertyActivator\PropertyActivator.cs (2)
60return properties.Select(createActivateInfo).ToArray(); 73return properties.Select(property =>
TypeFilterAttribute.cs (1)
66var argumentTypes = Arguments?.Select(a => a.GetType())?.ToArray();
Microsoft.AspNetCore.Mvc.Core.Test (31)
ApiConventionMethodAttributeTest.cs (1)
148string.Join(Environment.NewLine, attributes.Select(a => a.FullName)) +
ApiConventionTypeAttributeTest.cs (1)
83string.Join(Environment.NewLine, attributes.Select(a => a.ToString())) +
ApplicationModels\ControllerActionDescriptorProviderTests.cs (1)
30var actionNames = descriptors.Select(ad => ad.ActionName);
ApplicationModels\DefaultApplicationModelProviderTest.cs (1)
1388.Select(sm => sm.AttributeRouteModel)
ConsumesAttributeTests.cs (2)
42var contentTypes = content.Split(',').Select(contentType => contentType.Trim()).ToArray(); 62var contentTypes = content.Split(',').Select(contentType => contentType.Trim()).ToArray();
ControllerBaseTest.cs (1)
36.Select(method => new[] { method });
DependencyInjection\MvcBuilderExtensionsTest.cs (1)
88}.Select(t => t.GetTypeInfo()).ToArray();
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (1)
224.Select(sd => sd.ServiceType);
Filters\FilterProviderTest.cs (1)
143items.Select(item => item.Descriptor));
Formatters\AcceptHeaderParserTest.cs (1)
95var expectedMediaTypes = expected.Select(e => new MediaTypeSegmentWithQuality(new StringSegment(e), 1.0)).ToList();
Infrastructure\ActionSelectionTableTest.cs (1)
553var endpoints = actions.Select(a =>
Infrastructure\ActionSelectorTest.cs (2)
506var actionNames = string.Join(Environment.NewLine, actions.Select(action => action.DisplayName)); 999.Select(t => t.GetTypeInfo())
Infrastructure\ControllerActionInvokerTest.cs (1)
1574var messages = testSink.Writes.Select(write => write.State.ToString()).ToList();
Infrastructure\JsonResultExecutorTestBase.cs (1)
272var model = Enumerable.Range(0, 1000).Select(p => new TestModel { Property = new string('a', 5000) }).ToArray();
ModelBinding\Binders\HeaderModelBinderTests.cs (1)
307var headerValues = headerValue.Split(',').Select(s => s.Trim()).ToArray();
ModelBinding\Metadata\DefaultModelMetadataTest.cs (2)
568Assert.Equal(expectedNames.ToArray(), properties.Select(p => p.PropertyName).ToArray()); 680Assert.Equal(expectedNames.ToArray(), properties.Select(p => p.PropertyName).ToArray());
ModelBinding\Validation\DefaultModelValidatorProviderTest.cs (1)
172return metadata.ValidatorMetadata.Select(v => new ValidatorItem(v)).ToList();
ModelBinding\Validation\DefaultObjectValidatorTests.cs (2)
316var errorMessages = entry.Errors.Select(e => e.ErrorMessage); 348var errorMessages = entry.Errors.Select(e => e.ErrorMessage);
ProducesAttributeTests.cs (2)
97var contentTypes = content.Split(',').Select(contentType => contentType.Trim()).ToArray(); 119var contentTypes = content.Split(',').Select(contentType => contentType.Trim()).ToArray();
ProducesResponseTypeAttributeTests.cs (1)
38var contentTypes = content.Split(',').Select(contentType => contentType.Trim()).ToArray();
ResponseCacheAttributeTest.cs (2)
358expected.Split(',').Select(p => p.Trim()).OrderBy(item => item, StringComparer.Ordinal), 359actual.Split(',').Select(p => p.Trim()).OrderBy(item => item, StringComparer.Ordinal));
src\Shared\ResultsTests\FileStreamResultTestBase.cs (2)
378.Select(b => (byte)(b % 20)).ToArray(); 403.Select(b => (byte)(b % 20)).ToArray();
TestApplicationPart.cs (2)
28: this(types.Select(t => t.GetTypeInfo())) 33: this(types.Select(t => t.GetTypeInfo()))
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
LinkBuilder.cs (1)
37return Url + "?" + string.Join("&", Values.Select(kvp => kvp.Key + "=" + kvp.Value));
Microsoft.AspNetCore.Mvc.Cors.Test (1)
CorsAuthorizationFilterTest.cs (1)
159filterDescriptors.Select(filter => filter.Filter).ToList()
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
DataAnnotationsMetadataProvider.cs (1)
185.Select(name => underlyingType.GetField(name)!)
FileExtensionsAttributeAdapter.cs (1)
24var parsedExtensions = normalizedExtensions.Split(',').Select(e => "." + e);
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (4)
DataAnnotationsClientModelValidatorProviderTest.cs (1)
137return metadata.ValidatorMetadata.Select(v => new ClientValidatorItem(v)).ToList();
DataTypeClientModelValidatorProviderTest.cs (1)
85return metadata.ValidatorMetadata.Select(v => new ClientValidatorItem(v)).ToList();
DefaultModelClientValidatorProviderTest.cs (2)
192return metadata.ValidatorMetadata.Select(v => new ClientValidatorItem(v)).ToList(); 197return metadata.ValidatorMetadata.Select(v => new ValidatorItem(v)).ToList();
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (6)
XmlAssert.cs (1)
73element.Nodes().Select(child => SortAttributes(child)));
XmlDataContractSerializerInputFormatterTest.cs (2)
117.Select(content => content.ToString())); 119.Select(content => content.ToString()));
XmlSerializerInputFormatterTest.cs (2)
314.Select(content => content.ToString())); 316.Select(content => content.ToString()));
XmlSerializerOutputFormatterTest.cs (1)
346Enumerable.Range(1, 2).Select(i => "value" + i).AsQueryable(), typeof(IQueryable<string>), true };
Microsoft.AspNetCore.Mvc.FunctionalTests (18)
ApiBehaviorTest.cs (2)
332Assert.Equal(expected, json.Properties().OrderBy(p => p.Name).Select(p => p.Name)); 348Assert.Equal(expected, json.Properties().OrderBy(p => p.Name).Select(p => p.Name));
ApiExplorerTest.cs (10)
629responseType.ResponseFormats.Select(responseFormat => responseFormat.MediaType).OrderBy(o => o).ToArray()); 635responseType.ResponseFormats.Select(responseFormat => responseFormat.MediaType).OrderBy(o => o).ToArray()); 661responseType.ResponseFormats.Select(responseFormat => responseFormat.MediaType).ToArray()); 667responseType.ResponseFormats.Select(responseFormat => responseFormat.MediaType).ToArray()); 693responseType.ResponseFormats.Select(responseFormat => responseFormat.MediaType).OrderBy(o => o).ToArray()); 699responseType.ResponseFormats.Select(responseFormat => responseFormat.MediaType).OrderBy(o => o).ToArray()); 725responseType.ResponseFormats.Select(responseFormat => responseFormat.MediaType).ToArray()); 731responseType.ResponseFormats.Select(responseFormat => responseFormat.MediaType).ToArray()); 1314var actualMediaTypes = responseType.ResponseFormats.Select(r => r.MediaType).OrderBy(r => r); 1572.Select(format => format.MediaType);
src\Mvc\Mvc.Formatters.Xml\test\XmlAssert.cs (1)
73element.Nodes().Select(child => SortAttributes(child)));
TempDataInCookiesTest.cs (5)
79.Select(setCookieValue => SetCookieHeaderValue.Parse(setCookieValue)); 97.Select(setCookieValue => SetCookieHeaderValue.Parse(setCookieValue)) 130.Select(setCookieValue => SetCookieHeaderValue.Parse(setCookieValue)) 153.Select(setCookieValue => SetCookieHeaderValue.Parse(setCookieValue)) 183.Select(setCookieValue => SetCookieHeaderValue.Parse(setCookieValue))
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
HeaderModelBinderIntegrationTest.cs (1)
261expectedRawValue = value.Split(',').Select(v => v.Trim()).ToArray();
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
NewtonsoftJsonOutputFormatterTest.cs (1)
374var model = Enumerable.Range(0, 1000).Select(p => new User { FullName = new string('a', 5000) });
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (1)
272var model = Enumerable.Range(0, 1000).Select(p => new TestModel { Property = new string('a', 5000) }).ToArray();
Microsoft.AspNetCore.Mvc.Razor (2)
ApplicationParts\RazorCompiledItemFeatureProvider.cs (1)
28var viewsDifferingInCase = string.Join(Environment.NewLine, duplicates.Select(d => d.Identifier));
DependencyInjection\TagHelpersAsServices.cs (1)
22foreach (var type in feature.TagHelpers.Select(t => t.AsType()))
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
CompilationFailedException.cs (1)
27compilationFailures.SelectMany(f => f.Messages!).Select(message => message!.FormattedMessage));
CompilationFailedExceptionFactory.cs (2)
40messages: group.Select(parserError => CreateDiagnosticMessage(parserError, filePath))); 86group.Select(GetDiagnosticMessage),
PageActionDescriptorChangeProvider.cs (1)
82.Select(f => f.FilePath)
RazorReferenceManager.cs (1)
47.Select(CreateMetadataReference)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
AssemblyPartExtensionTest.cs (1)
25references.Select(Path.GetFileNameWithoutExtension));
PageLoaderMatcherPolicyTest.cs (1)
105actions.Select(CreateEndpoint).ToArray(),
Microsoft.AspNetCore.Mvc.Razor.Test (7)
ApplicationParts\RazorCompiledItemFeatureProviderTest.cs (5)
31Assert.Equal(new[] { item1, item2 }, feature.ViewDescriptors.Select(d => d.Item)); 60Assert.Equal(new[] { item1, item2 }, feature.ViewDescriptors.Select(d => d.Item)); 84Assert.Equal(new[] { item1, item2 }, feature.ViewDescriptors.Select(d => d.Item)); 129Assert.Equal(new[] { item1, item2 }, feature.ViewDescriptors.Select(d => d.Item)); 148Assert.Contains(typeof(RouteAttribute), item.Item.Metadata.Select(m => m.GetType())); // Verify we pick up new attributes
TestApplicationPart.cs (2)
28: this(types.Select(t => t.GetTypeInfo())) 33: this(types.Select(t => t.GetTypeInfo()))
Microsoft.AspNetCore.Mvc.RazorPages (8)
ApplicationModels\CompiledPageActionDescriptorBuilder.cs (2)
28globalFilters.Select(f => new FilterDescriptor(f, FilterScope.Global)), 29applicationModel.Filters.Select(f => new FilterDescriptor(f, FilterScope.Action)))
ApplicationModels\PageApplicationModel.cs (2)
67HandlerMethods = new List<PageHandlerModel>(other.HandlerMethods.Select(m => new PageHandlerModel(m))); 68HandlerProperties = new List<PagePropertyModel>(other.HandlerProperties.Select(p => new PagePropertyModel(p)));
ApplicationModels\PageHandlerModel.cs (1)
52Parameters = new List<PageParameterModel>(other.Parameters.Select(p => new PageParameterModel(p) { Handler = this }));
ApplicationModels\PageRouteModel.cs (1)
56Selectors = new List<SelectorModel>(other.Selectors.Select(m => new SelectorModel(m)));
Infrastructure\DefaultPageHandlerMethodSelector.cs (1)
51var ambiguousMethods = string.Join(", ", ambiguousMatches.Select(m => m.MethodInfo));
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
122"{ " + string.Join(", ", dynamicValues.Select(kvp => $"{kvp.Key}: {kvp.Value}")) + " }.");
Microsoft.AspNetCore.Mvc.RazorPages.Test (8)
ApplicationModels\CompiledPageActionDescriptorBuilderTest.cs (5)
91Assert.Equal(pageApplicationModel.Filters, actual.FilterDescriptors.Select(f => f.Filter)); 92Assert.Equal(pageApplicationModel.HandlerMethods.Select(p => p.MethodInfo), actual.HandlerMethods.Select(p => p.MethodInfo)); 93Assert.Equal(pageApplicationModel.HandlerProperties.Select(p => p.PropertyName), actual.BoundProperties.Select(p => p.Name));
Infrastructure\ExecutorFactoryTest.cs (2)
186return parameters.Select(s => GetDefaultValue(s)).ToArray(); 208return parameters.Select(p => new HandlerParameterDescriptor()
Infrastructure\PageActionInvokerTest.cs (1)
1408var messages = testSink.Writes.Select(write => write.State.ToString()).ToList();
Microsoft.AspNetCore.Mvc.TagHelpers (2)
TagHelperOutputExtensions.cs (2)
149var encodedSpaceChars = SpaceChars.Where(x => !x.Equals('\u0020')).Select(x => htmlEncoder.Encode(x.ToString())).ToArray(); 203var encodedSpaceChars = SpaceChars.Where(x => !x.Equals('\u0020')).Select(x => htmlEncoder.Encode(x.ToString())).ToArray();
Microsoft.AspNetCore.Mvc.TagHelpers.Test (24)
GlobbingUrlBuilderTest.cs (2)
217var collectionAssertions = expectedPaths.Select<string, Action<string>>(expected => 497var files = fileNames.Select(name => MakeFileInfo(name));
InputTagHelperTest.cs (2)
1078Assert.Equal(expectedEndOfFormContent, string.Join("", viewContext.FormContext.EndOfFormContent.Select(html => HtmlContentUtilities.HtmlContentToString(html)))); 1381Assert.Equal(expectedEndOfFormContent, string.Join("", viewContext.FormContext.EndOfFormContent.Select(html => HtmlContentUtilities.HtmlContentToString(html))));
SelectTagHelperTest.cs (20)
320var savedDisabled = items.Select(item => item.Disabled).ToList(); 321var savedGroup = items.Select(item => item.Group).ToList(); 322var savedSelected = items.Select(item => item.Selected).ToList(); 323var savedText = items.Select(item => item.Text).ToList(); 324var savedValue = items.Select(item => item.Value).ToList(); 349Assert.Equal(savedDisabled, items.Select(item => item.Disabled)); 350Assert.Equal(savedGroup, items.Select(item => item.Group)); 351Assert.Equal(savedSelected, items.Select(item => item.Selected)); 352Assert.Equal(savedText, items.Select(item => item.Text)); 353Assert.Equal(savedValue, items.Select(item => item.Value)); 501var savedDisabled = items.Select(item => item.Disabled).ToList(); 502var savedGroup = items.Select(item => item.Group).ToList(); 503var savedSelected = items.Select(item => item.Selected).ToList(); 504var savedText = items.Select(item => item.Text).ToList(); 505var savedValue = items.Select(item => item.Value).ToList(); 529Assert.Equal(savedDisabled, items.Select(item => item.Disabled)); 530Assert.Equal(savedGroup, items.Select(item => item.Group)); 531Assert.Equal(savedSelected, items.Select(item => item.Selected)); 532Assert.Equal(savedText, items.Select(item => item.Text)); 533Assert.Equal(savedValue, items.Select(item => item.Value));
Microsoft.AspNetCore.Mvc.Test (7)
MvcServiceCollectionExtensionsTest.cs (3)
418foreach (var serviceType in services.Select(d => d.ServiceType).Where(t => !t.IsGenericTypeDefinition).Distinct()) 467.Select(sd => sd.ServiceType); 626string.Join(Environment.NewLine, serviceDescriptors.Select(sd => sd.ImplementationType)));
Routing\ActionConstraintMatcherPolicyTest.cs (4)
357var endpoints = actions.Select(CreateEndpoint).ToArray(); 396var endpoints = actions.Select(CreateEndpoint).ToArray(); 425var endpoints = actions.Select(CreateEndpoint).ToArray(); 494actions.Select(CreateEndpoint).ToArray(),
Microsoft.AspNetCore.Mvc.Testing (1)
WebApplicationFactory.cs (1)
353testAssemblies.AddRange(runtimeAssemblies.Select(Assembly.Load));
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
DefaultHtmlGenerator.cs (1)
1016.Select(kvp => kvp.Key);
DependencyInjection\MvcViewFeaturesMvcBuilderExtensions.cs (1)
48foreach (var viewComponent in feature.ViewComponents.Select(vc => vc.AsType()))
RemoteAttributeBase.cs (1)
65.Select(FormatPropertyForClientValidation)
ViewComponents\DefaultViewComponentDescriptorProvider.cs (1)
34return GetCandidateTypes().Select(CreateDescriptor);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (96)
Buffers\ViewBufferTest.cs (6)
67var expected = Enumerable.Range(0, 32).Select(i => i.ToString(CultureInfo.InvariantCulture)); 85var expected = Enumerable.Range(0, 32).Select(i => i.ToString(CultureInfo.InvariantCulture)); 112var expected0 = Enumerable.Range(0, 32).Select(i => i.ToString(CultureInfo.InvariantCulture)); 113var expected1 = Enumerable.Range(32, 32).Select(i => i.ToString(CultureInfo.InvariantCulture)); 191var expected = string.Join("", Enumerable.Range(0, valuesToWrite).Select(_ => "abc")); 232var expected = string.Join("", Enumerable.Range(0, valuesToWrite).Select(_ => "abc"));
ControllerTest.cs (1)
29.Select(method => new[] { method });
DefaultEditorTemplatesTest.cs (1)
1628string.Join(" ", htmlAttributesDictionary.Select(entry => $"{ entry.Key }='{ entry.Value }'"));
Rendering\HtmlHelperFormTest.cs (1)
813dictionary.Select(keyValue => string.Format(CultureInfo.InvariantCulture, " {0}=\"HtmlEncode[[{1}]]\"", keyValue.Key, keyValue.Value)));
Rendering\HtmlHelperSelectTest.cs (80)
327var savedDisabled = selectList.Select(item => item.Disabled).ToList(); 328var savedGroup = selectList.Select(item => item.Group).ToList(); 329var savedSelected = selectList.Select(item => item.Selected).ToList(); 330var savedText = selectList.Select(item => item.Text).ToList(); 331var savedValue = selectList.Select(item => item.Value).ToList(); 338Assert.Equal(savedDisabled, selectList.Select(item => item.Disabled)); 339Assert.Equal(savedGroup, selectList.Select(item => item.Group)); 340Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 341Assert.Equal(savedText, selectList.Select(item => item.Text)); 342Assert.Equal(savedValue, selectList.Select(item => item.Value)); 355var savedSelected = selectList.Select(item => item.Selected).ToList(); 362Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 395var savedSelected = selectList.Select(item => item.Selected).ToList(); 402Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 600var savedSelected = selectList.Select(item => item.Selected).ToList(); 611Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 624var savedSelected = selectList.Select(item => item.Selected).ToList(); 635Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 648var savedSelected = selectList.Select(item => item.Selected).ToList(); 659Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 673var savedSelected = selectList.Select(item => item.Selected).ToList(); 684Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 694var savedSelected = selectList.Select(item => item.Selected).ToList(); 712Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 722var savedSelected = selectList.Select(item => item.Selected).ToList(); 735Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 748var savedDisabled = selectList.Select(item => item.Disabled).ToList(); 749var savedGroup = selectList.Select(item => item.Group).ToList(); 750var savedSelected = selectList.Select(item => item.Selected).ToList(); 751var savedText = selectList.Select(item => item.Text).ToList(); 752var savedValue = selectList.Select(item => item.Value).ToList(); 759Assert.Equal(savedDisabled, selectList.Select(item => item.Disabled)); 760Assert.Equal(savedGroup, selectList.Select(item => item.Group)); 761Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 762Assert.Equal(savedText, selectList.Select(item => item.Text)); 763Assert.Equal(savedValue, selectList.Select(item => item.Value)); 777var savedSelected = selectList.Select(item => item.Selected).ToList(); 784Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 798var savedSelected = selectList.Select(item => item.Selected).ToList(); 805Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1004var savedSelected = selectList.Select(item => item.Selected).ToList(); 1011Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1025var savedSelected = selectList.Select(item => item.Selected).ToList(); 1032Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1042var savedSelected = selectList.Select(item => item.Selected).ToList(); 1056Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1070var savedSelected = selectList.Select(item => item.Selected).ToList(); 1077Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1090var savedDisabled = selectList.Select(item => item.Disabled).ToList(); 1091var savedGroup = selectList.Select(item => item.Group).ToList(); 1092var savedSelected = selectList.Select(item => item.Selected).ToList(); 1093var savedText = selectList.Select(item => item.Text).ToList(); 1094var savedValue = selectList.Select(item => item.Value).ToList(); 1105Assert.Equal(savedDisabled, selectList.Select(item => item.Disabled)); 1106Assert.Equal(savedGroup, selectList.Select(item => item.Group)); 1107Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1108Assert.Equal(savedText, selectList.Select(item => item.Text)); 1109Assert.Equal(savedValue, selectList.Select(item => item.Value)); 1122var savedSelected = selectList.Select(item => item.Selected).ToList(); 1133Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1146var savedSelected = selectList.Select(item => item.Selected).ToList(); 1153Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1166var savedSelected = selectList.Select(item => item.Selected).ToList(); 1173Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1187var savedDisabled = selectList.Select(item => item.Disabled).ToList(); 1188var savedGroup = selectList.Select(item => item.Group).ToList(); 1189var savedSelected = selectList.Select(item => item.Selected).ToList(); 1190var savedText = selectList.Select(item => item.Text).ToList(); 1191var savedValue = selectList.Select(item => item.Value).ToList(); 1198Assert.Equal(savedDisabled, selectList.Select(item => item.Disabled)); 1199Assert.Equal(savedGroup, selectList.Select(item => item.Group)); 1200Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1201Assert.Equal(savedText, selectList.Select(item => item.Text)); 1202Assert.Equal(savedValue, selectList.Select(item => item.Value)); 1217var savedSelected = selectList.Select(item => item.Selected).ToList(); 1224Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1238var savedSelected = selectList.Select(item => item.Selected).ToList(); 1245Assert.Equal(savedSelected, selectList.Select(item => item.Selected)); 1260var savedSelected = selectList.Select(item => item.Selected).ToList(); 1267Assert.Equal(savedSelected, selectList.Select(item => item.Selected));
TemplateRendererTest.cs (1)
56var collectionAssertions = expectedResult.Select<string, Action<string>>(expected =>
TestApplicationPart.cs (2)
28: this(types.Select(t => t.GetTypeInfo())) 33: this(types.Select(t => t.GetTypeInfo()))
ViewComponents\DefaultViewComponentDescriptorProviderTest.cs (1)
164: base(GetApplicationPartManager(allowedTypes.Select(t => t.GetTypeInfo())))
ViewComponents\DefaultViewComponentHelperTest.cs (1)
185: base(GetApplicationPartManager(allowedTypes.Select(t => t.GetTypeInfo())))
ViewComponents\ViewComponentFeatureProviderTest.cs (1)
51Types = types.Select(t => t.GetTypeInfo());
ViewDataDictionaryTest.cs (1)
160{ model.Select(t => t) },
Microsoft.AspNetCore.OpenApi (8)
Extensions\JsonTypeInfoExtensions.cs (2)
99var propertyNames = string.Join("And", anonymousTypeProperties.Select(p => p.GetSchemaReferenceId(options))); 115var argumentNames = string.Join("And", genericArguments.Select(arg => arg.GetSchemaReferenceId(options)));
Extensions\OpenApiSchemaExtensions.cs (3)
42AllOf = schema.AllOf != null ? new List<OpenApiSchema>(schema.AllOf.Select(s => s.Clone())) : null, 43OneOf = schema.OneOf != null ? new List<OpenApiSchema>(schema.OneOf.Select(s => s.Clone())) : null, 44AnyOf = schema.AnyOf != null ? new List<OpenApiSchema>(schema.AnyOf.Select(s => s.Clone())) : null,
Schemas\OpenApiJsonSchema.Helpers.cs (1)
213schema.Enum = enumValues.Select(v => new OpenApiString(v)).ToList<IOpenApiAny>();
Services\OpenApiDocumentService.cs (2)
312return tagsMetadata.Tags.Select(tag => new OpenApiTag { Name = tag }).ToList(); 370.Select(responseFormat => responseFormat.MediaType);
Microsoft.AspNetCore.OpenApi.Microbenchmarks (4)
OpenApiSchemaComparerBenchmark.cs (4)
26AllOf = Enumerable.Range(0, ElementCount).Select(_ => GenerateInnerSchema()).ToList(), 27AnyOf = Enumerable.Range(0, ElementCount).Select(_ => GenerateInnerSchema()).ToList(), 40Enum = Enumerable.Range(0, ElementCount).Select(_ => (IOpenApiAny)new OpenApiString("enum")).ToList(), 41OneOf = Enumerable.Range(0, ElementCount).Select(_ => GenerateInnerSchema()).ToList(),
Microsoft.AspNetCore.OpenApi.Tests (7)
Comparers\OpenApiSchemaComparerTests.cs (1)
104var propertyNames = typeof(OpenApiSchema).GetProperties().Select(property => property.Name).ToList();
Extensions\OpenApiSchemaExtensionsTests.cs (1)
14var propertyNames = typeof(OpenApiSchema).GetProperties().Select(property => property.Name).ToList();
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Servers.cs (3)
34Assert.Contains("http://localhost:5000", servers.Select(s => s.Url)); 58Assert.Contains("http://localhost:5000", servers.Select(s => s.Url)); 59Assert.Contains("http://localhost:5002", servers.Select(s => s.Url));
Transformers\OperationTransformerTests.cs (2)
60Assert.All(document.Paths.Values.SelectMany(p => p.Operations).Select(p => p.Value), o => Assert.Equal("6", o.Description)); 114Assert.All(document.Paths.Values.SelectMany(p => p.Operations).Select(p => p.Value), o => Assert.Equal("6", o.Description));
Microsoft.AspNetCore.Owin (8)
DictionaryStringArrayWrapper.cs (3)
38ICollection<string[]> IDictionary<string, string[]>.Values => Inner.Values.Select(Convert).ToList(); 58IEnumerator IEnumerable.GetEnumerator() => Inner.Select(Convert).GetEnumerator(); 60IEnumerator<KeyValuePair<string, string[]>> IEnumerable<KeyValuePair<string, string[]>>.GetEnumerator() => Inner.Select(Convert).GetEnumerator();
DictionaryStringValuesWrapper.cs (3)
83ICollection<StringValues> IDictionary<string, StringValues>.Values => Inner.Values.Select(Convert).ToList(); 103IEnumerator IEnumerable.GetEnumerator() => Inner.Select(Convert).GetEnumerator(); 105IEnumerator<KeyValuePair<string, StringValues>> IEnumerable<KeyValuePair<string, StringValues>>.GetEnumerator() => Inner.Select(Convert).GetEnumerator();
OwinEnvironment.cs (2)
163.Select(pair => pair.Key).Concat(_context.Items.Keys.Select(key => Convert.ToString(key, CultureInfo.InvariantCulture))).ToList();
Microsoft.AspNetCore.ResponseCompression.Tests (2)
ResponseCompressionMiddlewareTest.cs (2)
26TestData.Select(x => new object[] { x.EncodingName }); 29TestData.Select(x => new object[] { x.EncodingName, x.ExpectedBodyLength });
Microsoft.AspNetCore.Routing (25)
DataTokensMetadata.cs (1)
36return DebuggerHelpers.GetDebugText(nameof(DataTokens), DataTokens.Select(t => $"{t.Key}={t.Value ?? "(null)"}"));
DefaultLinkGenerator.cs (3)
344EndpointsFound(logger, endpoints.Select(e => e.DisplayName), address); 417LinkGenerationSucceeded(logger, endpoints.Select(e => e.DisplayName), uri); 432LinkGenerationFailed(logger, endpoints.Select(e => e.DisplayName));
DefaultLinkParser.cs (2)
177EndpointsFound(logger, endpoints.Select(e => e.DisplayName), address); 204PathParsingFailed(logger, endpoints.Select(e => e.DisplayName), path.Value);
HostAttribute.cs (1)
56: string.Join(',', Hosts.Select(h => h.Contains(':') ? h : h + ":*"));
HttpMethodMetadata.cs (1)
41HttpMethods = httpMethods.Select(GetCanonicalizedValue).ToArray();
Matching\CandidateSet.cs (1)
351string.Join(Environment.NewLine, duplicates.Select(e => e.DisplayName));
Matching\DefaultEndpointSelector.cs (1)
123string.Join(Environment.NewLine, matches.Select(e => e.DisplayName)));
Matching\DfaNode.cs (1)
124builder.AppendJoin(", ", Literals.Select(kvp => $"{kvp.Key}->({FormatNode(kvp.Value)})"));
Matching\DictionaryJumpTable.cs (1)
50builder.AppendJoin(", ", _dictionary.Select(kvp => $"{kvp.Key}: {kvp.Value}"));
Matching\EndpointMetadataComparer.cs (1)
40.Select(p => p.Comparer)
Matching\LinearSearchJumpTable.cs (1)
51builder.AppendJoin(", ", _entries.Select(e => $"{e.text}: {e.destination}"));
Patterns\RoutePattern.cs (1)
163return RawText ?? string.Join(SeparatorString, PathSegments.Select(s => s.DebuggerToString()));
Patterns\RoutePatternPathSegment.cs (1)
49return string.Join(string.Empty, parts.Select(p => p.DebuggerToString()));
RouteValuesAddress.cs (1)
33_toString ??= $"{RouteName}({string.Join(',', ExplicitValues.Select(kv => $"{kv.Key}=[{kv.Value}]"))})";
Template\RouteTemplate.cs (2)
110return string.Join(SeparatorString, Segments.Select(s => s.DebuggerToString())); 139var segments = Segments.Select(s => s.ToRoutePatternPathSegment());
Template\TemplatePart.cs (2)
44InlineConstraints = parameter.ParameterPolicies?.Select(p => new InlineConstraint(p)) ?? Enumerable.Empty<InlineConstraint>(); 173var constraints = InlineConstraints.Select(c => new RoutePatternParameterPolicyReference(c.Constraint));
Template\TemplateSegment.cs (2)
52return string.Join(string.Empty, Parts.Select(p => p.DebuggerToString())); 61var parts = Parts.Select(p => p.ToRoutePatternPart());
Tree\LinkGenerationDecisionTree.cs (1)
248sb.AppendJoin(", ", node.Matches.Select(m => m.Entry.RouteTemplate.TemplateText));
Tree\UrlMatchingNode.cs (1)
84return $"Length: {Depth}, Matches: {string.Join(" | ", Matches?.Select(m => $"({m.TemplateMatcher.Template.TemplateText})"))}";
Microsoft.AspNetCore.Routing.Abstractions (1)
RouteData.cs (1)
193public DictionaryItemDebugView<string, object?>[] Items => _routeData.Values.Select(pair => new DictionaryItemDebugView<string, object>(pair)).ToArray();
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
src\Http\Routing\test\UnitTests\Matching\BarebonesMatcherBuilder.cs (1)
25.Select(s => s.IsSimple && s.Parts[0] is RoutePatternLiteralPart literalPart ? literalPart.Content : null)
Microsoft.AspNetCore.Routing.Tests (9)
Matching\BarebonesMatcherBuilder.cs (1)
25.Select(s => s.IsSimple && s.Parts[0] is RoutePatternLiteralPart literalPart ? literalPart.Content : null)
Matching\ContentEncodingNegotiationMatcherPolicyTest.cs (2)
631endpoints.Select(e => new RouteValueDictionary()).ToArray(), 632endpoints.Select(e => 1).ToArray());
Matching\DfaMatcherBuilderTest.cs (3)
3606.Select(g => new PolicyNodeEdge(g.Key, g.ToArray())) 3648.Select(g => new PolicyNodeEdge(g.Key, g.ToArray())) 3673.Select(g => new PolicyNodeEdge(g.Key, g.ToArray()))
Matching\FullFeaturedMatcherConformanceTest.cs (1)
428var endpoints = templates.Select((t) => CreateEndpoint(t)).ToArray();
Matching\MatcherAssert.cs (1)
106return values == null ? "{}" : "{" + string.Join(", ", values.Select(kvp => $"{kvp.Key} = '{kvp.Value}'")) + "}";
Template\TemplateBinderTests.cs (1)
1456.Select(s => s.Split(new char[] { '=' }, StringSplitOptions.None))
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
300public KeyValuePair<string, string>[] Items => _collection.Select(pair => new KeyValuePair<string, string>(pair.Key, pair.Value.ToString())).ToArray();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
RequestTests.cs (1)
397var errorLogs = TestSink.Writes.Where(w => w.LogLevel >= LogLevel.Error).Select(w => w.Exception);
Microsoft.AspNetCore.Server.IIS (6)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
300public KeyValuePair<string, string>[] Items => _collection.Select(pair => new KeyValuePair<string, string>(pair.Key, pair.Value.ToString())).ToArray();
src\Shared\RazorViews\BaseView.cs (1)
286.Select(HtmlEncoder.Encode));
src\Shared\StackTrace\ExceptionDetails\ExceptionDetailsProvider.cs (1)
42.Select(frame => GetStackFrameSourceCodeInfo(
src\Shared\StackTrace\StackFrame\MethodDisplayInfo.cs (1)
47builder.AppendJoin(", ", Parameters.Select(p => p.ToString()));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
110.Select(arg => TypeNameHelper.GetTypeDisplayName(arg, fullName: false, includeGenericParameterNames: true))) + ">"; 114var parameters = method.GetParameters().Select(parameter =>
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (1)
233var environmentVariables = string.Join("`,", _deploymentParameters.EnvironmentVariables.Select(envVariable => $"{envVariable.Key}={envVariable.Value}"));
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Internal\Http\HttpHeaders.cs (2)
119ICollection<string> IDictionary<string, StringValues>.Keys => ((IDictionary<string, StringValues>)this).Select(pair => pair.Key).ToHashSet(StringComparer.OrdinalIgnoreCase); 121ICollection<StringValues> IDictionary<string, StringValues>.Values => ((IDictionary<string, StringValues>)this).Select(pair => pair.Value).ToList();
Internal\KestrelServerImpl.cs (2)
350var urlsToStop = endpointsToStop.Select(lo => lo.EndpointConfig!.Url); 378var urlsToStart = endpointsToStart.Select(lo => lo.EndpointConfig!.Url);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
299var hashes = matches.OfType<Match>().Select(m => m.Groups[1].Value).ToList();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (35)
AsciiDecoding.cs (5)
18var byteRange = Enumerable.Range(1, 127).Select(x => (byte)x); 61var byteRange = Enumerable.Range(1, length).Select(x => (byte)x).ToArray(); 72var byteRange = Enumerable.Range(0, 16384 + 64).Select(x => (byte)((x & 0x7f) | 0x01)).ToArray(); 92var byteRange = Enumerable.Range(0, 4096).Select(x => (byte)((x & 0x7f) | 0x01)).ToArray(); 115var byteRange = Enumerable.Range(1, 127).Select(x => (byte)x);
BufferWriterTests.cs (1)
137IEnumerable<byte> source = Enumerable.Range(0, memory.Length).Select(i => (byte)i);
Http1\Http1ConnectionTests.cs (1)
1110.Select(i => $"Header-{startAt + i}: value{startAt + i}\r\n"));
Http2\Http2HPackEncoderTests.cs (1)
664.ToDictionary(g => g.Key, g => new StringValues(g.Select(gg => gg.Value).ToArray()));
HttpParserTests.cs (6)
848Assert.Equal(expectedHeaderNames, parsedHeaders.Select(t => t.Key)); 849Assert.Equal(expectedHeaderValues, parsedHeaders.Select(t => t.Value)); 857public static IEnumerable<object[]> RequestLineIncompleteData => HttpParsingData.RequestLineIncompleteData.Select(requestLine => new[] { requestLine }); 859public static IEnumerable<object[]> RequestLineInvalidDataLineFeedTerminator => HttpParsingData.RequestLineInvalidDataLineFeedTerminator.Select(requestLine => new[] { requestLine }); 861public static IEnumerable<object[]> RequestLineInvalidData => HttpParsingData.RequestLineInvalidData.Select(requestLine => new[] { requestLine }); 863public static IEnumerable<object[]> MethodWithNonTokenCharData => HttpParsingData.MethodWithNonTokenCharData.Select(method => new[] { method });
HttpRequestHeadersTests.cs (2)
891RequestHeaders.Where(h => h.Name != "Content-Length").Select(h => new object[] { true, h.Name }).Concat( 892RequestHeaders.Where(h => h.Name != "Content-Length").Select(h => new object[] { false, h.Name }));
SniOptionsSelectorTests.cs (1)
809var propertyNames = typeof(SslServerAuthenticationOptions).GetProperties().Select(property => property.Name).ToList();
src\Servers\Kestrel\shared\KnownHeaders.cs (13)
40.Select(h => h.Name) 79.Concat(FormattedInternalHeaderNames.Select(x => x.Identifier)) 181ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 252ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 279ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 299.Select(header => 1L << header.Index) 303.Where(header => FormattedInternalHeaderNames.Where(x => x.IsPseudoHeader).Select(x => x.Identifier).Contains(header.Identifier)) 304.Select(header => 1L << header.Index) 310return values.Any() ? values.Select(formatter).Aggregate((a, b) => a + b) : ""; 403var useVarForFirstTerm = values.Count > 1 && values.Select(h => h.FirstNameIgnoreCaseSegment()).Distinct().Count() == 1; 404var firstTermVarExpression = values.Select(h => h.FirstNameIgnoreCaseSegment()).FirstOrDefault(); 784.Select(h => h.Identifier).Distinct().OrderBy(n => n, StringComparer.InvariantCulture).ToArray(); 937{Each(ApiHeaderNames.Where(header => header != "ContentLength" && !loop.Headers.Select(kh => kh.Identifier).Contains(header)), header => $@"
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
179var args = string.Join(".", protocols.Select(p => ProtocolToString(p)));
src\Servers\Kestrel\shared\test\HttpParsingData.cs (1)
238}.Concat(MethodWithNonTokenCharData.Select(method => $"{method} / HTTP/1.0\r\n"));
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
60AddEndpoints(startingPort, unavailableEndpoints, properties.GetActiveTcpConnections().Select(c => c.LocalEndPoint));
src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (1)
50private static readonly string _literalHeaderNameString = string.Concat(Enumerable.Range(0, 4100).Select(c => (char)('a' + (c % 26))));
UTF8Decoding.cs (1)
36var byteRange = Enumerable.Range(1, length).Select(x => (byte)x).ToArray();
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
715.ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray()));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
60AddEndpoints(startingPort, unavailableEndpoints, properties.GetActiveTcpConnections().Select(c => c.LocalEndPoint));
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (2)
25.Select(u => u.Port); 31.Select(a => new Uri(a));
Microsoft.AspNetCore.Session (1)
DistributedSession.cs (1)
127return _store.Keys.Select(key => key.KeyString);
Microsoft.AspNetCore.Shared.Tests (20)
runtime\Http2\HPackDecoderTest.cs (1)
50private static readonly string _literalHeaderNameString = string.Concat(Enumerable.Range(0, 4100).Select(c => (char)('a' + (c % 26))));
runtime\Http2\HuffmanDecodingTests.cs (1)
122int encodedBits = currentPrefix.Select(b => Huffman.Encode(b).bitLength).Sum();
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
300public KeyValuePair<string, string>[] Items => _collection.Select(pair => new KeyValuePair<string, string>(pair.Key, pair.Value.ToString())).ToArray();
src\Shared\PropertyActivator\PropertyActivator.cs (2)
60return properties.Select(createActivateInfo).ToArray(); 73return properties.Select(property =>
src\Shared\StackTrace\StackFrame\MethodDisplayInfo.cs (1)
47builder.AppendJoin(", ", Parameters.Select(p => p.ToString()));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
110.Select(arg => TypeNameHelper.GetTypeDisplayName(arg, fullName: false, includeGenericParameterNames: true))) + ">"; 114var parameters = method.GetParameters().Select(parameter =>
StackTraceHelperTest.cs (11)
61var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray(); 75var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray(); 89var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray(); 104var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray(); 119var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray(); 134var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray(); 148var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray(); 179var methodNames = stackFrames.Select(stackFrame => stackFrame.MethodDisplayInfo.ToString()).ToArray(); 195var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray(); 210var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray(); 225var methods = stackFrames.Select(frame => frame.MethodDisplayInfo.ToString()).ToArray();
UrlDecoderTests.cs (1)
195return PathTestData.Select(x =>
Microsoft.AspNetCore.SignalR.Client.Core (2)
HubConnection.Log.cs (2)
31var argsList = args == null ? string.Empty : string.Join(", ", args.Select(a => a?.GetType().FullName ?? "(null)")); 88var argsList = args == null ? string.Empty : string.Join(", ", args.Select(a => a?.GetType().FullName ?? "(null)"));
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
Hubs.cs (1)
73return headerNames.Select(h => (string)headers[h]);
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (4)
HubClientProxyGenerator.Parser.cs (2)
286.Select(member => (IMethodSymbol)member) 290.Select(member => (IMethodSymbol)member)), SymbolEqualityComparer.Default).ToList();
HubServerProxyGenerator.Parser.cs (2)
263.Select(member => (IMethodSymbol)member) 267.Select(member => (IMethodSymbol)member)));
Microsoft.AspNetCore.SignalR.Client.Tests (1)
HubConnectionTests.ConnectionLifecycle.cs (1)
35public static IEnumerable<object[]> MethodsNamesThatRequireActiveConnection => MethodsThatRequireActiveConnection.Keys.Select(k => new object[] { k });
Microsoft.AspNetCore.SignalR.Common (4)
Protocol\HubMethodInvocationMessage.cs (4)
104args = Arguments == null ? string.Empty : string.Join(", ", Arguments.Select(a => a?.ToString())); 113streamIds = string.Join(", ", StreamIds != null ? StreamIds.Select(id => id?.ToString()) : Array.Empty<string>()); 159args = Arguments == null ? string.Empty : string.Join(", ", Arguments.Select(a => a?.ToString())); 168streamIds = string.Join(", ", StreamIds != null ? StreamIds.Select(id => id?.ToString()) : Array.Empty<string>());
Microsoft.AspNetCore.SignalR.Common.Tests (26)
Internal\Formatters\BinaryMessageFormatterTests.cs (1)
152Enumerable.Range(0, size).Select(n => (byte)(n & 0xff)).ToArray();
Internal\Protocol\JsonHubProtocolTests.cs (1)
222public static IEnumerable<object[]> CustomProtocolTestDataNames => CustomProtocolTestData.Keys.Select(name => new object[] { name });
Internal\Protocol\JsonHubProtocolTestsBase.cs (4)
98public static IEnumerable<object[]> ProtocolTestDataNames => ProtocolTestData.Keys.Select(name => new object[] { name }); 111public static IEnumerable<object[]> OutOfOrderJsonTestDataNames => OutOfOrderJsonTestData.Keys.Select(name => new object[] { name }); 384public static IEnumerable<object[]> MessageSizeDataNames => MessageSizeData.Keys.Select(name => new object[] { name }); 431public static IEnumerable<object[]> ClientResultDataNames => ClientResultData.Keys.Select(name => new object[] { name });
Internal\Protocol\MemoryBufferWriterTests.cs (12)
82var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 101var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 165var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 181var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 199var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 215var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 232var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 251var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 269var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 289var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 316var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray(); 336var input = Enumerable.Range(0, inputSize).Select(i => (byte)i).ToArray();
Internal\Protocol\MessagePackHubProtocolTestBase.cs (3)
348public static IEnumerable<object[]> BaseInvalidPayloadNames => BaseInvalidPayloads.Keys.Select(name => new object[] { name }); 386public static IEnumerable<object[]> ArgumentBindingErrorNames => ArgumentBindingErrors.Keys.Select(name => new object[] { name }); 436public static IEnumerable<object[]> MessageSizeDataNames => MessageSizeData.Keys.Select(name => new object[] { name });
Internal\Protocol\MessagePackHubProtocolTests.cs (1)
210public static IEnumerable<object[]> ClientResultDataNames => ClientResultData.Keys.Select(name => new object[] { name });
Internal\Protocol\NewtonsoftJsonHubProtocolTests.cs (1)
108public static IEnumerable<object[]> CustomProtocolTestDataNames => CustomProtocolTestData.Keys.Select(name => new object[] { name });
Internal\Protocol\TestBinder.cs (2)
21_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray(); 24_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray();
Internal\Protocol\Utf8BufferTextWriterTests.cs (1)
281var allSegments = bufferWriter.GetSegments().Select(s => s.ToArray()).ToArray();
Microsoft.AspNetCore.SignalR.Core (4)
Internal\HubMethodDescriptor.cs (2)
137}).Select(p => p.ParameterType).ToArray(); 141OriginalParameterTypes = methodExecutor.MethodParameters.Select(p => p.ParameterType).ToArray();
Internal\TypedClientBuilder.cs (2)
123var paramTypes = parameters.Select(param => param.ParameterType).ToArray(); 149paramTypes.Where(p => p.IsGenericParameter).Select(p => p.Name).Distinct().ToArray();
Microsoft.AspNetCore.SignalR.Microbenchmarks (3)
HubConnectionReceiveBenchmark.cs (1)
88_hubConnection.On(MethodName, arguments.Select(v => v.GetType()).ToArray(), OnInvoke);
TestBinder.cs (2)
18_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray(); 21_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray();
Microsoft.AspNetCore.SignalR.StackExchangeRedis (2)
Internal\RedisLog.cs (1)
18ConnectingToEndpoints(logger, string.Join(", ", endpoints.Select(EndPointCollection.ToString)), serverName);
RedisHubLifetimeManager.cs (1)
82var supportedProtocols = hubProtocolResolver.AllProtocols.Select(p => p.Name).ToList();
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (5)
DefaultHubMessageSerializerTests.cs (1)
116public static IEnumerable<object[]> InvocationTestData = _invocationTestData.Keys.Select(k => new object[] { k });
RedisProtocolTests.cs (4)
31public static IEnumerable<object[]> AckTestData = _ackTestData.Keys.Select(k => new object[] { k }); 63public static IEnumerable<object[]> GroupCommandTestData = _groupCommandTestData.Keys.Select(k => new object[] { k }); 138public static IEnumerable<object[]> InvocationTestData = _invocationTestData.Keys.Select(k => new object[] { k }); 248public static IEnumerable<object[]> CompletionMessageTestData = _completionMessageTestData.Keys.Select(k => new object[] { k });
Microsoft.AspNetCore.SignalR.Tests (3)
HubConnectionHandlerTests.cs (1)
1430var values = ((JArray)invocation.Arguments[0]).Select(t => t.Value<int>()).ToArray();
Internal\DefaultHubProtocolResolverTests.cs (1)
103public static IEnumerable<object[]> HubProtocolNames => HubProtocolHelpers.AllProtocols.Select(p => new object[] { p.Name });
UserAgentHeaderTest.cs (1)
30public static IEnumerable<object[]> UserAgentTestDataNames => UserAgents.Keys.Select(name => new object[] { name });
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
src\Shared\SignalR\VerifyNoErrorScope.cs (1)
47errorMessage += string.Join(Environment.NewLine, results.Select(record =>
Microsoft.AspNetCore.Testing (1)
ServiceFakesHostExtensions.cs (1)
79.Select(x => new Uri(x.Replace("[::]", "localhost", StringComparison.OrdinalIgnoreCase)));
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
1990var displayNames = ds.Endpoints.Select(e => e.DisplayName).ToArray();
Microsoft.AspNetCore.WebSockets (1)
WebSocketMiddleware.cs (1)
42_allowedOrigins = _options.AllowedOrigins.Select(o => o.ToLowerInvariant()).ToList();
Microsoft.AspNetCore.WebSockets.ConformanceTests (3)
Autobahn\AutobahnResult.cs (1)
20return new AutobahnResult(indexJson.Properties().Select(AutobahnServerResult.FromJson));
Autobahn\AutobahnServerResult.cs (1)
36return new AutobahnServerResult(prop.Name, valueObj.Properties().Select(AutobahnCaseResult.FromJson));
Autobahn\AutobahnSpec.cs (1)
54new JProperty("servers", new JArray(Servers.Select(s => s.GetJson()).ToArray())),
Microsoft.AspNetCore.WebSockets.Tests (2)
IHostPortExtensions.cs (2)
21.Select(u => u.Port); 27.Select(a => new Uri(a));
Microsoft.AspNetCore.WebUtilities.Tests (7)
FileBufferingReadStreamTests.cs (7)
467var data = Enumerable.Range(0, bufferSize * mostExpectedWrites).Select(b => (byte)b).ToArray(); 491var data = Enumerable.Reverse(Enumerable.Range(0, bufferSize * mostExpectedWrites).Select(b => (byte)b)).ToArray(); 512var data = Enumerable.Range(0, 1024).Select(b => (byte)b).ToArray(); 529var data = Enumerable.Range(0, 1024).Select(b => (byte)b).ToArray(); 547var data = Enumerable.Range(0, 1024).Select(b => (byte)b).ToArray(); 566var data = Enumerable.Range(0, 1024).Select(b => (byte)b).ToArray(); 586var data = Enumerable.Range(0, 1024).Select(b => (byte)b).ToArray();
Microsoft.Build (80)
BackEnd\BuildManager\GlobalPropertiesLookup.cs (2)
37.Select(p => new KeyValuePair<string, string?>(p.Key, ExtractEscapedValue(p.Value))) 60public IEnumerable<string?> Values => _backingProperties.Values.Select(ExtractEscapedValue);
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (2)
107.Select(nc => new NodeInfo(nc.NodeId, ProviderType)) 211return _nodeContexts.Values.Select(context => context.Process);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (1)
612return _nodeContexts.Values.Select(context => context.Process);
BackEnd\Components\Logging\ProjectLoggingContext.cs (1)
241properties = projectPropertiesToSerialize.Select((ProjectPropertyInstance property) => new DictionaryEntry(property.Name, property.EvaluatedValue));
BackEnd\Components\ProjectCache\CacheResult.cs (1)
117pluginTargetResult.TaskItems.Select(ti => CreateTaskItem(ti)).ToArray(),
BackEnd\Components\ProjectCache\ProjectCacheService.cs (2)
377.Select(type => new { type, info = type.GetTypeInfo() }) 383.Select(t => t.type);
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (1)
629return group.Where(item => metadataSet.Contains(matchOnMetadata.Select(m => item.GetMetadataValue(m)))).ToList();
BackEnd\Components\RequestBuilder\Lookup.cs (1)
849List<string> metadataToRemove = new List<string>(itemToModify.Metadata.Where(m => modificationsToApply[m.Name].Remove).Select(m => m.Name));
BackEnd\Components\RequestBuilder\TargetBuilder.cs (1)
188BuildResult resultsToReport = new BuildResult(_buildResult, targetNames.Select(target => target.name).ToArray());
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
775string.Join(";", undeclaredProjects.Select(p => $"\"{p}\"")),
BackEnd\Components\Scheduler\Scheduler.cs (2)
1770config.GlobalProperties.ToDictionary().Select(kvp => $"{kvp.Key}={kvp.Value}")); 2047return string.Join("; ", configuration.GlobalProperties.Select<ProjectPropertyInstance, string>(p => $"{p.Name}={p.EvaluatedValue}"));
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (3)
102return manifestsList.Select(manifest => manifest.Path).ToList(); 227.Select(type => new { type, info = type.GetTypeInfo() }) 229.Select(t => t.type);
BackEnd\Shared\BuildRequestConfiguration.cs (1)
841.Select(s => MSBuildGlob.Parse(Project.Directory, s)));
BuildCheck\Infrastructure\BuildCheckBuildEventHandler.cs (1)
182=> title + Environment.NewLine + String.Join(Environment.NewLine, rowData.Select(a => $"{a.Key},{a.Value}")) + Environment.NewLine;
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (3)
208instance.SupportedRules.Select(r => r.Id).ToArray(), 275!check.SupportedRules.Select(r => r.Id) 280$"The check '{check.FriendlyName}' exposes rules '{check.SupportedRules.Select(r => r.Id).ToCsvString()}', but different rules were declared during registration: '{checkFactoryContext.RuleIds.ToCsvString()}'");
BuildEnvironmentHelper.cs (1)
336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name)))
Collections\CopyOnReadEnumerable.cs (1)
82list.AddRange(_backingEnumerable.Select(_selector));
Construction\ProjectRootElement.cs (1)
1909foreach (string sdk in sdks.Split(MSBuildConstants.SemicolonChar).Select(i => i.Trim()))
Definition\Project.cs (4)
2787.Select(pair => pair.Result) 2862foreach (ProjectRootElement import in _data.ImportClosure.Where(i => i.ImportingElement?.ImplicitImportLocation == ImplicitImportLocation.Top).Select(i => i.ImportedProject)) 2877foreach (ProjectRootElement import in _data.ImportClosure.Where(i => i.ImportingElement?.ImplicitImportLocation == ImplicitImportLocation.Bottom).Select(i => i.ImportedProject)) 3927IEnumerable<ProjectRootElement> children = _data.ImportClosure.Where(resolvedImport => ReferenceEquals(resolvedImport.ImportingElement, import)).Select(triple => triple.ImportedProject);
Definition\ProjectItem.cs (1)
148IEnumerable<KeyValuePair<string, string>> IItemData.EnumerateMetadata() => Metadata.Select(m => new KeyValuePair<string, string>(m.Name, m.EvaluatedValue));
Evaluation\Evaluator.cs (4)
733_usingTaskElements.Select(p => (p.Value, p.Key)), 1113_evaluationLoggingContext.LogWarning("", new BuildEventFileInfo(""), "ChangeWave_InvalidFormat", Traits.Instance.MSBuildDisableFeaturesFromVersion, $"[{String.Join(", ", ChangeWaves.AllWaves.Select(x => x.ToString()))}]"); 1116_evaluationLoggingContext.LogWarning("", new BuildEventFileInfo(""), "ChangeWave_OutOfRotation", ChangeWaves.DisabledWave, Traits.Instance.MSBuildDisableFeaturesFromVersion, $"[{String.Join(", ", ChangeWaves.AllWaves.Select(x => x.ToString()))}]"); 2507var onlyFallbackSearchPaths = searchPathMatch.SearchPaths.Select(s => _data.ExpandString(s)).ToList();
Evaluation\Expander.cs (2)
2065var joinedItems = string.Join(expressionCapture.Separator, itemsFromCapture.Select(i => i.Key)); 5016? string.Join(", ", args.Select(a => a?.GetType().Name ?? "null"))
Evaluation\ItemSpec.cs (5)
93return ReferencedItems.Select(v => EscapingUtilities.UnescapeAll(v.ItemAsValueFragment.TextFragment)); 109return CompositeGlob.Create(ReferencedItems.Select(i => i.ItemAsValueFragment.ToMSBuildGlob())); 128itemsFromCapture.Select(i => new ReferencedItem(i.Value, new ValueFragment(i.Key, ProjectDirectory))).ToList(); 386return CompositeGlob.Create(Fragments.Select(f => f.ToMSBuildGlob())); 590this.Add(metadata.Select(m => referencedItem.Item.GetMetadataValue(m)), comparer);
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (3)
77return listBuilder.Select(itemData => itemData.Item) 112: string.Join(";", CapturedItems.Select(kvp => $"{kvp.Key} : {kvp.Value.EvaluatedInclude}")); 265_itemFactory.SetMetadata(metadataList, itemBatchingContexts.Select(i => i.OperationItem));
Evaluation\LazyItemEvaluator.RemoveOperation.cs (2)
92return _metadataSet.Contains(_matchOnMetadata.Select(m => item.GetMetadataValue(m))); 104var globs = _itemSpec.Fragments.OfType<GlobFragment>().Select(g => g.TextFragment);
Graph\GraphBuilder.cs (4)
92EntryPointNodes = _entryPointConfigurationMetadata.Select(e => allParsedProjects[e].GraphNode).ToList(); 97ProjectNodes = allParsedProjects.Values.Select(p => p.GraphNode).ToList(); 259string.Join(";", entryPoints.Select(e => e.ProjectFile)))); 607var errorMessage = new StringBuilder(projectsInCycle.Select(p => p.Length).Sum());
Graph\ProjectGraph.cs (3)
459etwArgs = string.Join(";", entryPoints.Select( 464: string.Join(", ", e.GlobalProperties.Select(kvp => $"{kvp.Key} = {kvp.Value}")); 522.Select(kvp => $"{kvp.Key}={kvp.Value}"));
Graph\ProjectInterpretation.cs (2)
509.Select(t => new TargetSpecification(t, skipNonexistentTargets)).ToArray(); 532.Select(t => t.Target)
Instance\ProjectInstance.cs (2)
3344IEnumerable<ProjectMetadataInstance> projectMetadataInstances = item.DirectMetadata.Select(directMetadatum => new ProjectMetadataInstance(directMetadatum)); 3402IEnumerable<ProjectMetadataInstance> projectMetadataInstances = item.DirectMetadata.Select(directMetadatum => new ProjectMetadataInstance(directMetadatum));
Instance\ProjectItemDefinitionInstance.cs (1)
62IEnumerable<ProjectMetadataInstance> projectMetadataInstances = itemDefinition.Metadata.Select(originalMetadata => new ProjectMetadataInstance(originalMetadata));
Instance\ProjectItemInstance.cs (7)
129IEnumerable<ProjectMetadataInstance> directMetadataInstances = directMetadata.Select(metadatum => new ProjectMetadataInstance(metadatum.Key, metadatum.Value)); 608IEnumerable<ProjectMetadataInstance> projectMetadataInstances = metadataList.Select(metadatum => new ProjectMetadataInstance(metadatum.Key, metadatum.Value)); 1085_directMetadata.ImportProperties(metadata.Select(kvp => new ProjectMetadataInstance(kvp.Key, kvp.Value, allowItemSpecModifiers: true))); 1452.Select(metadatum => new KeyValuePair<string, string>(metadatum.Name, GetMetadataEscaped(metadatum.Name))); 1790Enumerable.Range(0, count).Select(_ => 1895.Select(item => new ProjectMetadataInstance(item.Key, item.Value, true /* may be built-in metadata name */)); 2063IEnumerable<ProjectMetadataInstance> projectMetadataInstances = metadataList.Select(metadatum => new ProjectMetadataInstance(metadatum.Key.Name, metadatum.Value));
Logging\BaseConsoleLogger.cs (1)
634IItem<ProjectMetadata> iitem => iitem.Metadata?.Select(m => new KeyValuePair<string, string>(m.Name, m.EvaluatedValue)),
PrintLineDebuggerWriters.cs (1)
95var joinedArgs = $"{EscapeCommas(callsite)},{string.Join(",", args.Select(arg => EscapeCommas(arg)))}\n";
Utilities\EngineFileUtilities.cs (2)
217var excludeSpecsUnescaped = excludeSpecsEscaped?.Where(IsValidExclude).Select(i => EscapingUtilities.UnescapeAll(i)).ToList(); 578.Select(fs => new Lazy<FileSpecMatcherTester>(() => FileSpecMatcherTester.Parse(currentDirectory, fs)))
Utilities\Utilities.cs (10)
720.Select(t => t.itemValue.Select(itemValue => new ItemData(t.itemType, (IItemData)itemValue))) 727.Select(t => t.itemValue.Select(itemValue => new ItemData(t.itemType, (IItemData)itemValue))) 751.Select(i => new ItemData(i.ItemType, (IItemData)i)); 757.Select(i => new ItemData(i.ItemType, (IItemData)i)); 778return typeNames.Select(typeName => 780.Select(i => new ItemData(i.ItemType, (IItemData)i))) 785return typeNames.Select(typeName => 787.Select(i => new ItemData(i.ItemType, (IItemData)i)))
Microsoft.Build.BuildCheck.UnitTests (1)
BuildCheckManagerProviderTests.cs (1)
47_logger.AllBuildEvents.Where(be => be.GetType() == typeof(BuildMessageEventArgs)).Select(be => be.Message).ToArray()
Microsoft.Build.CommandLine.UnitTests (1)
CommandLineSwitches_Tests.cs (1)
1548.Select(i => new KeyValuePair<string, string>((string)i.Key, (string)i.Value)))
Microsoft.Build.Engine.OM.UnitTests (19)
BuildEnvironmentHelper.cs (1)
336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name)))
Construction\ConstructionEditing_Tests.cs (1)
3254splits = splits.Select(s => s.Trim()).ToArray();
Definition\Project_Tests.cs (1)
3739var uberGlob = CompositeGlob.Create(getAllGlobsResult.Select(r => r.MsBuildGlob));
Definition\ProjectItem_Tests.cs (15)
763expectedInclude = expectedInclude.Select(p => setSlashes(p, Path.DirectorySeparatorChar)).ToArray(); 2332Assert.Equal(@"a;a", string.Join(";", items.Select(i => i.EvaluatedInclude))); 2343Assert.Equal(@"a.txt;b.cs", string.Join(";", items.Select(i => i.EvaluatedInclude))); 2355Assert.Equal(@"a;c", string.Join(";", items.Select(i => i.EvaluatedInclude))); 2385Assert.Equal(@"a;b", string.Join(";", project.Items.Select(i => i.EvaluatedInclude))); 2402Assert.Equal(@"a;b;c", string.Join(";", project.ItemsIgnoringCondition.Select(i => i.EvaluatedInclude))); 2424items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "d2" }); 2451items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "d2" }); 2485items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "b2", "c2", "g2" }); 2498items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "b2", "c2", "g2" }); 2528items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "../foo.txt", "/foo/bar.txt" }); 2560items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "d2" }); 2597items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "c2", "d2" }); 2627items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "b2", "c2", "d2" }); 3663.Select(i => (ObjectModelHelpers.ITestItem)new ObjectModelHelpers.ProjectItemTestItemAdapter(i))
PrintLineDebuggerWriters.cs (1)
95var joinedArgs = $"{EscapeCommas(callsite)},{string.Join(",", args.Select(arg => EscapeCommas(arg)))}\n";
Microsoft.Build.Engine.UnitTests (104)
BackEnd\BinaryTranslator_Tests.cs (1)
255.Select(t => new object[] { t });
BackEnd\BuildManager_Tests.cs (2)
3528var resultsFiles = Directory.EnumerateFiles(directory).Select(Path.GetFileName); 3811string.Join(";", result.ResultsByTarget["MainTarget"].Items.Select(i => i.ItemSpec)));
BackEnd\IntrinsicTask_Tests.cs (9)
1779items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "d2" }); 1813items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "d2" }); 1857items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "b2", "c2", "g2" }); 1870items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "b2", "c2", "g2" }); 1910items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "../foo.txt", "/foo/bar.txt" }); 1944items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "d2" }); 1982items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "c2", "d2" }); 2018items.Select(i => i.EvaluatedInclude).ShouldBe(new[] { "a2", "b2", "c2", "d2" }); 4004return lookup.GetItems(itemType).Select(i => (ObjectModelHelpers.ITestItem)new ObjectModelHelpers.ProjectItemInstanceTestItemAdapter(i)).ToList();
BackEnd\SdkResolverLoader_Tests.cs (1)
49resolvers.Select(i => i.GetType().FullName).ShouldBe(new[] { typeof(DefaultSdkResolver).FullName });
BackEnd\SdkResolverService_Tests.cs (17)
64_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain("MockSdkResolver1 running"); 65_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain("MockSdkResolver2 running"); 66_logger.BuildMessageEvents.Select(i => i.Message).ShouldNotContain("MockSdkResolverWithResolvableSdkPattern1 running"); 67_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain("MockSdkResolverWithResolvableSdkPattern2 running"); 77_logger.Warnings.Select(i => i.Message).ShouldBe(new[] { "WARNING4", "WARNING2" }); 133_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain("MockSdkResolverWithResolvableSdkPattern2 running"); 134_logger.BuildMessageEvents.Select(i => i.Message).ShouldNotContain("MockSdkResolver1 running"); 135_logger.BuildMessageEvents.Select(i => i.Message).ShouldNotContain("MockSdkResolver2 running"); 197_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain("MockSdkResolver1 running"); 198_logger.BuildMessageEvents.Select(i => i.Message).ShouldNotContain("MockSdkResolverWithResolvableSdkPattern1 running"); 214_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain("MockSdkResolverWithResolvableSdkPattern1 running"); 215_logger.BuildMessageEvents.Select(i => i.Message).ShouldNotContain("MockSdkResolver1 running"); 228_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("SDKResolverAttempt", nameof(MockResolverReturnsNull), sdk.ToString(), "null", 231_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("SucceededToResolveSDK", sdk.ToString(), nameof(MockSdkResolver1), result.Path, result.Version)); 264_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain("MockSdkResolver1 running"); 265_logger.BuildMessageEvents.Select(i => i.Message).ShouldContain("MockSdkResolver2 running"); 268_logger.Warnings.Select(i => i.Message).ShouldBe(new[] { "WARNING2" });
BackEnd\SdkResultOutOfProc_Tests.cs (1)
202.Select(i => i.ItemSpec)
BackEnd\TargetBuilder_Tests.cs (1)
1562return new BuildRequest(1 /* submissionId */, _nodeRequestId++, configurationId, targets.Select(t => t.name).ToArray(), null, BuildEventContext.Invalid, null, flags);
BackEnd\TaskExecutionHost_Tests.cs (2)
1117IList<string> messages = ml.TaskParameterEvents.Select(e => e.Message).ToList(); 1123messages = ml.BuildMessageEvents.Select(e => e.Message).ToList();
BackEnd\TaskRegistry_Tests.cs (1)
2189usingTaskElements.Select(el => (el, currentDir)),
BackEnd\TranslationHelpers.cs (3)
183.Select(i => i.Key.ToString() + GetTaskItemString(i.Value)); 192.Select(i => GetTaskItemString(i)); 225return string.Join(";", dictionary.Select(kvp => kvp.Key + "=" + kvp.Value));
BuildEventArgsSerialization_Tests.cs (4)
565.Select(v => v.TotalSeconds.ToString(CultureInfo.InvariantCulture)).ToCsvString(false)); 1051BinaryLogRecordKind unknownType = (BinaryLogRecordKind)Enum.GetValues(typeof(BinaryLogRecordKind)).Cast<BinaryLogRecordKind>().Select(e => (int)e).Max() + 2; 1198return string.Join(";", items.Select(i => ToString(i))); 1203return i.ItemSpec + string.Join(";", i.CloneCustomMetadata().Keys.OfType<string>().Select(k => i.GetMetadata(k)));
Construction\SolutionProjectGenerator_Tests.cs (1)
1062Assert.True(buildResult, String.Join(Environment.NewLine, logger.Errors.Select(beea => beea.Message)));
Definition\ProjectEvaluationContext_Tests.cs (6)
465.Select(i => $"{projectName}.{i}") 521.Select(i => Path.Combine("..", "Glob", projectName, $"{projectName}.{i}")) 584.Select(i => Path.Combine("Glob", "1", i)) 591.Select(i => Path.Combine(project1Directory.Path, i)) 652.Select(i => Path.Combine(globFixedDirectoryPart, i)) 719.Select(p => string.Format(p, itemSpecDirectoryPart))
Definition\Toolset_Tests.cs (2)
122foreach (string key in t.Properties.Values.Select(p => p.Name)) 140foreach (string subToolsetPropertyKey in subToolset1.Properties.Values.Select(p => p.Name))
Evaluation\Expander_Tests.cs (8)
3952.Select(t => new object[] { t }); 3972object[] hashes = stringsToHash.Select(toHash => 4801var includes = myDirectories.Select(i => i.EvaluatedInclude); 4845var includes = myDirectories.Select(i => i.EvaluatedInclude); 4877squiggles.Select(i => i.EvaluatedInclude).ShouldBe(new[] 4923squiggleItems.Select(i => i.EvaluatedInclude).ShouldBe(new[] { alphaOnePath, alphaThreePath }, Case.Insensitive); 4964squiggleItems.Select(i => i.EvaluatedInclude).ShouldBe(new[] { alphaBetaPath, alphaDeltaPath }, Case.Insensitive); 5181_ = logger.AllBuildEvents.Select(be => be.ShouldBeOfType<BuildCheckAcquisitionEventArgs>());
Evaluation\ItemEvaluation_Tests.cs (1)
557Assert.Equal("0;6;7;8;9", String.Join(";", items.Select(i => i.EvaluatedInclude)));
Evaluation\SdkResultEvaluation_Tests.cs (2)
98item.Metadata.Select(m => (m.Name, m.EvaluatedValue)) 457item.Metadata.Select(m => (m.Name, m.EvaluatedValue))
EvaluationProfiler_Tests.cs (1)
254var allIds = profiledElements.Select(e => e.Id).ToList();
ExpressionTreeExpression_Tests.cs (3)
166}.Select(s => new[] { s }); 223}.Select(s => new[] { s }); 359}.Select(s => new[] { s });
FileMatcher_Tests.cs (7)
105foreach (string fullPath in GetFilesComplexGlobbingMatchingInfo.FilesToCreate.Select(i => Path.Combine(testFolder.Path, i.ToPlatformSlash()))) 127.Select(i => i.Replace(Path.DirectorySeparatorChar, '\\')) 153Verify(info.Include, info.Excludes?.Select(o => o.Replace('\\', '/')).ToArray(), customMessage: "Excludes directory separator was changed to forward slash"); 162Verify(info.Include, info.Excludes?.Select(o => o.ToUpperInvariant()).ToArray(), false, "Excludes were changed to uppercase"); 2386var forwardSlashExcludeSpecs = excludeFilespecs.Select(Helpers.ToForwardSlash).ToArray(); 2406Func<string[], string[]> normalizeAllFunc = (paths => normalizeAllPaths ? paths.Select(MockFileSystem.Normalize).ToArray() : paths); 2407Func<string[], string[]> normalizeMatching = (paths => normalizeExpectedMatchingFiles ? paths.Select(MockFileSystem.Normalize).ToArray() : paths);
Graph\GraphLoadedFromSolution_tests.cs (10)
499solutionDependencies: solutionDependencies.Select(dependency => (dependency.Item1.ToString(), dependency.Item2.ToString())).ToArray()) 641return edgeInfos.Where(e => e.Key.Item1.Equals(node.ToConfigurationMetadata())).Select(e => e.Value); 646return edgeInfos.Where(e => e.Key.Item2.Equals(node.ToConfigurationMetadata())).Select(e => e.Value); 690graph.ProjectNodes.Count.ShouldBe(graph.ProjectNodes.Select(GetProjectPath).Distinct().Count()); 693graphFromSolution.EntryPointNodes.Select(GetProjectPath) 694.ShouldBeSetEquivalentTo(graph.ProjectNodes.Select(GetProjectPath)); 698graphFromSolution.GraphRoots.Select(GetProjectPath) 699.ShouldBeSameIgnoringOrder(graph.GraphRoots.Select(GetProjectPath)); 701graphFromSolution.ProjectNodes.Select(GetProjectPath) 702.ShouldBeSameIgnoringOrder(graph.ProjectNodes.Select(GetProjectPath));
Graph\GraphTestingUtilities.cs (1)
243node.ProjectReferences.Select(GetProjectNumber).ShouldBeSameIgnoringOrder(expectedReferences);
Graph\ProjectGraph_Tests.cs (7)
863projectGraph.EntryPointNodes.Select(node => node.ProjectInstance.FullPath).ShouldBe(new[] { project1Path, project2Path, project3Path, project6Path, project8Path }, ignoreOrder: true); 865projectGraph.GraphRoots.Select(node => node.ProjectInstance.FullPath).ShouldBe(new[] { project1Path, project6Path }, ignoreOrder: true); 872project1Node.ProjectReferences.Select(node => node.ProjectInstance.FullPath).ShouldBe(new[] { project2Path, project3Path, project8Path }, ignoreOrder: true); 878project2Node.ProjectReferences.Select(node => node.ProjectInstance.FullPath).ShouldBe(new[] { project4Path }, ignoreOrder: true); 884project3Node.ProjectReferences.Select(node => node.ProjectInstance.FullPath).ShouldBe(new[] { project5Path }, ignoreOrder: true); 2108var referenceNumbersSet = innerBuildWithCommonReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet(); 2114referenceNumbersSet = innerBuildWithAdditionalReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet();
Graph\ResultCacheBasedBuilds_Tests.cs (5)
59cacheContents.Select(Convert.ToChar) 363rootNodeBuildResult.ResultsByTarget["Build"].Items.Select(i => i.ItemSpec).ToArray().ShouldBe(expectedOutput[rootNode]); 452var cacheFilesForReferences = node.ProjectReferences.Where(r => outputCaches.ContainsKey(r)).Select(r => outputCaches[r]).ToArray(); 482var actualOutput = result.ResultsByTarget["Build"].Items.Select(i => i.ItemSpec).ToArray(); 531Projects='{string.Join(";", projectReferences.Select(i => $"{i}.proj"))}'
ProjectCache\ProjectCacheTests.cs (7)
161GraphEdges.Select(e => $"{Node(e.Key)}->{FormatChildren(e.Value)}")); 167: string.Join(",", children.Select(c => Node(c))); 697var referenceBuildTasks = rootNode.ProjectReferences.Select( 1580.Select(i => _env.CreateFile($"project{i}.proj", project).Path) 1618buildRequests.AddRange(projectPaths.Select(r => (r, cacheNotApplicableTarget))); 1619buildRequests.AddRange(projectPaths.Select(r => (r, cacheHitTarget))); 1627foreach (var buildResult in buildTasks.Select(buildTask => buildTask.Result))
WarningsAsMessagesAndErrors_Tests.cs (1)
262{(customProperties != null ? String.Join(Environment.NewLine, customProperties.Select(i => $"<{i.Key}>{i.Value}</{i.Key}>")) : "")}
Microsoft.Build.Framework (2)
ImmutableSegmentedDictionary.cs (1)
81.AddRange(source.Select(element => new KeyValuePair<TKey, TValue>(keySelector(element), elementSelector(element))));
Sdk\SdkReference.cs (1)
87var parts = sdk.Split(MSBuildConstants.ForwardSlash).Select(i => i.Trim()).ToArray();
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (8)
MapSourceRootTests.cs (2)
349}, task.MappedSourceRoots.Select(InspectSourceRoot)); 452}, task.MappedSourceRoots.Select(InspectSourceRoot));
TargetTests.cs (2)
876var caps = instance.GetItems("ProjectCapability").Select(c => c.EvaluatedInclude); 894var caps = instance.GetItems("ProjectCapability").Select(c => c.EvaluatedInclude);
TestUtilities\DotNetSdkTestBase.cs (1)
237var evaluationResult = File.ReadAllLines(evaluationResultsFile).Select(l => (l != EmptyValueMarker) ? l : "");
TestUtilities\MSBuildUtil.cs (1)
19return fileNames.Select(CreateTaskItem).ToArray();
TestUtilities\TaskTestUtil.cs (2)
26Assert.Equal(expected, task.GenerateCommandLineArgsTaskItems(rsp).Select(x => x.ItemSpec)); 39Assert.Equal(expected, compilerTask.CommandLineArgs!.Select(x => x.ItemSpec));
Microsoft.Build.Tasks.Core (20)
AssemblyFoldersFromConfig.cs (1)
72.Select(target => new AssemblyFoldersFromConfigInfo(target.Path, GetFrameworkVersion(target.FrameworkVersion)));
BootstrapperUtil\BootstrapperBuilder.cs (2)
453packagePaths.AddRange(Util.AdditionalPackagePaths.Select(p => Util.AddTrailingChar(p.ToLowerInvariant(), System.IO.Path.DirectorySeparatorChar))); 495List<string> list = _cultures.Values.Select(v => v.ToString()).ToList();
BuildEnvironmentHelper.cs (1)
336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name)))
NativeMethods.cs (1)
1413.Select(x => Convert.ToByte(value.Substring(x, 2), 16)).ToArray());
PrintLineDebuggerWriters.cs (1)
95var joinedArgs = $"{EscapeCommas(callsite)},{string.Join(",", args.Select(arg => EscapeCommas(arg)))}\n";
ResolveSDKReference.cs (4)
465ResolvedSDKReferences = sdkReferenceItems.Where(x => x.Resolved).Select(x => x.ResolvedItem).ToArray(); 536.Select(y => String.Format(CultureInfo.CurrentCulture, "\"{0}\"", y)) 549return dependsOnSDK.Split(MSBuildConstants.SemicolonChar, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).Where(y => y.Length > 0).ToList<string>(); 1350string[] appxComponents = appxLocation.Key.Split(s_appxSplitChar, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToArray();
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (3)
189.Select(i => new TaskPropertyInfo( 247codeNamespace.Imports.AddRange(DefaultNamespaces.Union(taskInfo.Namespaces, StringComparer.OrdinalIgnoreCase).Select(i => new CodeNamespaceImport(i)).ToArray()); 586items = hasInvalidReference ? null : resolvedAssemblyReferences.Select(i => (ITaskItem)new TaskItem(i)).ToArray();
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (1)
43return possibleLocations.Select(possibleLocation => possibleLocation()).FirstOrDefault(File.Exists);
SetRidAgnosticValueForProjects.cs (1)
22.Select(p =>
WriteCodeFragment.cs (5)
260() => Type.GetType(attribute.Name, throwOnError: false) ?? NamespaceImports.Select(x => Type.GetType($"{x}.{attribute.Name}", throwOnError: false)).FirstOrDefault(), 481.Select(c => c.GetParameters().Select(p => p.ParameterType).ToArray()) 517.OrderBy(c => string.Join(",", c.Select(t => t.FullName))) 525return positionalParameters.Select(x => default(Type)).ToArray();
Microsoft.Build.Tasks.UnitTests (14)
Copy_Tests.cs (1)
2025filesActuallyCopied.Select(f => Path.GetFileName(f.Key.Name)).ShouldBe(new[] { "a.cs", "b.cs" }, ignoreOrder: true);
Exec_Tests.cs (1)
176((MockEngine)exec.BuildEngine).WarningEvents.Select(w => w.Message)));
Hash_Tests.cs (3)
95.Select(cnt => new string('a', cnt)) 96.Select(GetHash) 99.Select(g => g.Key);
ProjectExtensionsImportTestBase.cs (2)
231logger.Errors.Select(i => i.Code).FirstOrDefault().ShouldBe("MSB3540"); 258logger.Warnings.Select(i => i.Code).FirstOrDefault().ShouldBe("MSB3539");
RoslynCodeTaskFactory_Tests.cs (1)
761var logLines = logger.AllBuildEvents.Select(a => a.Message);
WriteCodeFragment_Tests.cs (2)
606.Select(l => $"\"{l}\"") 1180.Select(line => line.Trim())
XmlPeek_Tests.cs (2)
358Assert.Equal(["abcdefg", "a$(d)fg", "a$(d.f)"], p.Result.Select(x => x.ItemSpec)); 359Assert.Equal(["abcdefg", "a%24%28d%29fg", "a%24%28d.f%29"], p.Result.Cast<TaskItem>().Select(x => x.ToString()));
ZipDirectory_Tests.cs (2)
50.Select(i => i.FullName) 92.Select(i => i.FullName)
Microsoft.Build.UnitTests.Shared (12)
EngineTestEnvironment.cs (2)
211var expectedLoggers = expectedLoggerPairs.Select(l => l.logger).ToArray(); 232PlaybackBinlog(binaryLoggerFilePath, actualLoggerPairs.Select(k => k.logger).ToArray());
EnvironmentProvider.cs (2)
52.Select(p => p.Trim('"'))); 66.Select(p => Path.Combine(p, commandNameWithExtension))
ObjectModelHelpers.cs (7)
128.Select(i => (ITestItem)new ProjectItemTestItemAdapter(i)) 149expectedInclude = expectedInclude.Select(i => Path.Combine(testProject.TestRoot, i)).ToArray(); 250var converteditems = items.Select(i => (ITestItem)new ProjectItemTestItemAdapter(i)).ToList(); 277var convertedItems = items.Select(i => (ITestItem)new ProjectItemTestItemAdapter(i)).ToList(); 1094return string.Join(itemSeparator, project.Items.Where(i => i.ItemType.Equals(itemType)).Select(i => i.EvaluatedInclude)); 1800? nodes.Where(n => entryPoints.Contains(n.Key)).Select(n => n.Value.ProjectPath) 1801: nodes.Where(n => n.Value.IsRoot).Select(n => n.Value.ProjectPath);
TestEnvironment.cs (1)
505foreach (FileInfo file in newFiles.Except(_originalFiles).Select(f => new FileInfo(f)))
Microsoft.Build.Utilities.Core (9)
AssemblyFoldersFromConfig.cs (1)
72.Select(target => new AssemblyFoldersFromConfigInfo(target.Path, GetFrameworkVersion(target.FrameworkVersion)));
BuildEnvironmentHelper.cs (1)
336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name)))
LockCheck.cs (1)
250return string.Join(", ", GetLockingProcessInfos(filePath).Select(p => $"{p.ApplicationName} ({p.ProcessId})"));
PrintLineDebuggerWriters.cs (1)
95var joinedArgs = $"{EscapeCommas(callsite)},{string.Join(",", args.Select(arg => EscapeCommas(arg)))}\n";
TaskItem.cs (1)
508_metadata.SetItems(metadata.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value ?? string.Empty)));
ToolLocationHelper.cs (3)
1424.Select(i => i.Path); 1431var folders = string.IsNullOrEmpty(subFolder) ? vsInstallFolders : vsInstallFolders.Select(i => Path.Combine(i, subFolder)); 2600SortedDictionary<Version, List<string>> versionsInRoot = VersionUtilities.GatherVersionStrings(null, rootPathWithIdentifier.GetDirectories().Select<DirectoryInfo, string>(directory => directory.Name));
ToolTask.cs (1)
1331.Select(folderPath => Path.Combine(folderPath, filename))
Microsoft.Cci.Extensions (10)
Dgml\DgmlExtensions.cs (2)
16var definedNames = materializedAssemblies.Select(a => a.Name.Value); 17var referencedNames = materializedAssemblies.SelectMany(a => a.AssemblyReferences).Select(ar => ar.Name.Value);
Differs\ElementDifferenceFactory.cs (1)
49_diffRules = rules.Select(r => r.CreateExport().Value).ToArray();
Differs\ListMerger.cs (1)
19return ListMerger.Merge<T>(array0, array1).Select(t => new SimpleElementMapping<T>(t.Item1, t.Item2));
Extensions\CSharp\CSharpCciExtensions.cs (1)
865IEnumerable<InterfaceImplementation> foundInterfaces = typeDefinition.GetInterfaceImplementations().Select(metadataReader.GetInterfaceImplementation).Where(impl => metadataReader.GetToken(impl.Interface) == (int)interfaceImplementationToken);
Extensions\TypeExtensions.cs (1)
319types = ns.Members.Select<INamespaceMember, INamespaceTypeDefinition>(nsMember =>
Filters\BaselineDifferenceFilter.cs (1)
74return _ignoreDifferences.Where(i => !i.Value).Select(i => i.Key);
HostEnvironment.cs (1)
257.Select(ar => ar.AssemblyIdentity)
Writers\CSharp\CSDeclarationWriter.Attributes.cs (1)
76string.Join("|", ops.ToString().Split(',').Select(x => "System.Runtime.CompilerServices.MethodImplOptions." + x.TrimStart())) :
Writers\Syntax\HtmlSyntaxWriter.cs (1)
146tooltip = string.Join(", ", differences.Select(d => d.Message));
Microsoft.CodeAnalysis (35)
CodeGen\PrivateImplementationDetails.cs (3)
173_orderedSynthesizedMethods = _synthesizedMethods.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Value).AsImmutable(); 176_orderedTopLevelTypes = _synthesizedTopLevelTypes.OrderBy(kvp => kvp.Key).Select(kvp => (Cci.INamespaceTypeDefinition)kvp.Value).AsImmutable(); 179_orderedProxyTypes = _proxyTypes.OrderBy(kvp => kvp.Key.Size).ThenBy(kvp => kvp.Key.Alignment).Select(kvp => kvp.Value).AsImmutable();
CommandLine\CommandLineParser.cs (1)
1034return builder.ToArrayAndFree().Select(static x => x.ToString());
CommandLine\CommonCompiler.cs (2)
602=> ReportDiagnostics(diagnostics.Select(info => Diagnostic.Create(info)), consoleOutput, errorLoggerOpt, compilation); 646foreach (var key in assemblyInternal.GetInternalsVisibleToPublicKeys(simpleName).Select(k => AssemblyIdentity.PublicKeyToString(k)).OrderBy(k => k))
CommandLine\SarifV2ErrorLogger.cs (1)
91.Select(suppression => $"Suppression Id: {suppression.Descriptor.Id}, Suppression Justification: {suppression.Descriptor.Justification}")
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
392.Select(x => (x.Key, x.Value?.RealAssemblyPath ?? ""))
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1476var actionsByKind = actionsByKindBuilder.Select(a => a.ToImmutableAndFree()).ToImmutableArray();
DiagnosticAnalyzer\AnalyzerExecutor.cs (2)
944var tuples = nodeActionsByKind.Select(kvp => KeyValuePairUtil.Create(kvp.Key, kvp.Value.ToImmutableAndFree())); 1043var tuples = operationActionsByKind.Select(kvp => KeyValuePairUtil.Create(kvp.Key, kvp.Value.ToImmutableAndFree()));
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
648typeSymbol = typeSymbol.Construct(typeArguments.Select(t => t.Type).ToArray());
DiagnosticAnalyzer\SymbolDeclaredCompilationEvent.cs (1)
53var loc = DeclaringSyntaxReferences.Length != 0 ? " @ " + string.Join(", ", System.Linq.Enumerable.Select(DeclaringSyntaxReferences, r => r.GetLocation().GetLineSpan())) : null;
Emit\CommonPEModuleBuilder.cs (1)
812NestedTypes.Select(t => t.Name).Distinct().Count() == NestedTypes.Count());
InternalUtilities\EnumerableExtensions.cs (2)
362builder.AddRange(source.Select(selector)); 540return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
InternalUtilities\ImmutableSetWithInsertionOrder`1.cs (1)
61get { return _map.OrderBy(kv => kv.Value).Select(kv => kv.Key); }
Operations\ControlFlowGraphBuilder.cs (1)
7958.Select(m => (IPropertySymbol)m);
PEWriter\MetadataWriter.cs (1)
2038this.module.GetSourceAssemblySecurityAttributes().Select(sa => sa.Attribute),
ReferenceManager\CommonReferenceManager.State.cs (1)
682return ReferencedAssembliesMap.Select(ra => KeyValuePairUtil.Create(ra.Key, (IAssemblySymbolInternal)ReferencedAssemblies[ra.Value]));
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (1)
23return string.Join(s_separator, flattened.InnerExceptions.Select(e => GetExceptionMessage(e)));
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (1)
81.AddRange(source.Select(element => new KeyValuePair<TKey, TValue>(keySelector(element), elementSelector(element))));
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (1)
114return Enumerable.Select(immutableList, selector);
Syntax\SeparatedSyntaxList.cs (1)
166return _list.Where(n => n.IsToken).Select(n => n.AsToken());
Syntax\SyntaxDiffer.cs (1)
68return reducedChanges.Select(c => new TextChange(c.Range.Span, c.NewText!)).ToList();
Syntax\SyntaxNode.cs (6)
1046return this.DescendantNodesAndTokens(descendIntoChildren, descendIntoTrivia).Where(sn => sn.IsToken).Select(sn => sn.AsToken()); 1054return this.DescendantNodesAndTokens(span, descendIntoChildren, descendIntoTrivia).Where(sn => sn.IsToken).Select(sn => sn.AsToken()); 1283return this.GetAnnotatedNodesAndTokens(syntaxAnnotation).Where(n => n.IsNode).Select(n => n.AsNode()!); 1293return this.GetAnnotatedNodesAndTokens(annotationKind).Where(n => n.IsNode).Select(n => n.AsNode()!); 1301return this.GetAnnotatedNodesAndTokens(syntaxAnnotation).Where(n => n.IsToken).Select(n => n.AsToken()); 1309return this.GetAnnotatedNodesAndTokens(annotationKind).Where(n => n.IsToken).Select(n => n.AsToken());
Syntax\SyntaxNode.Iterators.cs (1)
20? DescendantNodesAndTokensImpl(span, descendIntoChildren, true, includeSelf).Where(e => e.IsNode).Select(e => e.AsNode()!)
Syntax\SyntaxNodeExtensions_Tracking.cs (1)
204foreach (var node in root.GetAnnotatedNodesAndTokens(IdAnnotationKind).Select(n => n.AsNode()!))
Syntax\SyntaxToken.cs (1)
671: diagnostics.Select(s_createDiagnosticWithoutLocation);
TreeDumper.cs (1)
220return string.Format("{{{0}}}", string.Join(", ", seq.Cast<object>().Select(DumperString).ToArray()));
Microsoft.CodeAnalysis.CodeStyle (38)
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
217properties = properties.AddRange(tagIndices.Select(kvp => new KeyValuePair<string, string?>(kvp.Key, EncodeIndices(kvp.Value, additionalLocations.Count()))));
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
648typeSymbol = typeSymbol.Construct(typeArguments.Select(t => t.Type).ToArray());
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (2)
362builder.AddRange(source.Select(selector)); 540return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (1)
81.AddRange(source.Select(element => new KeyValuePair<TKey, TValue>(keySelector(element), elementSelector(element))));
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (1)
114return Enumerable.Select(immutableList, selector);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (2)
48.Select(x => x.section) 86.Select(x => x.section)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
512.Select(p => (p.Type ?? compilation.GetSpecialType(SpecialType.System_Object)).WithNullableAnnotation(p.NullableAnnotation));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
772return type?.RemoveUnavailableTypeParameters(compilation, availableTypeParameters.Select(t => t.Name).ToSet());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolDisplayPartExtensions.cs (1)
13=> string.Join(string.Empty, parts.Select(p => p.ToString()));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
328=> node.GetAnnotatedNodesAndTokens(syntaxAnnotation).Select(n => n.AsNode()).OfType<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
237foreach (var symbol in SymbolsWriteBuilder.Keys.Select(d => d.symbol).ToArray())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
226foreach (var (symbol, write) in SymbolsWriteBuilder.Where(kvp => !kvp.Value).Select(kvp => kvp.Key).ToArray())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (1)
49=> _formattingSpans ?? new TextSpanMutableIntervalTree(_formattingResults.Select(r => r.FormattedSpan));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (2)
272var tokens = node.GetAnnotatedTrivia(SyntaxAnnotation.ElasticAnnotation).Select(tr => tr.Token).Distinct(); 273return AggregateSpans(tokens.Select(GetElasticSpan));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (3)
154foreach (var symbolSpecApplicableKind in symbolSpecApplicableKinds.Split(',').Select(x => x.Trim())) 247foreach (var symbolSpecApplicableAccessibility in symbolSpecApplicableAccessibilities.Split(',').Select(x => x.Trim())) 317foreach (var symbolSpecRequiredModifier in symbolSpecRequiredModifiers.Split(',').Select(x => x.Trim()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (7)
72return words.Select(CapitalizeFirstLetter); 74return words.Take(1).Select(DecapitalizeFirstLetter).Concat(words.Skip(1).Select(CapitalizeFirstLetter)); 76return words.Take(1).Select(CapitalizeFirstLetter).Concat(words.Skip(1).Select(DecapitalizeFirstLetter)); 78return words.Select(w => w.ToUpper()); 80return words.Select(w => w.ToLower());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (2)
336.Select(NamingStyle.FromXElement).ToImmutableArray(), 338.Select(SerializableNamingRule.FromXElement).ToImmutableArray());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (1)
156.Select(ch =>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
129.AddRange(alternativeEntries.Select(static p => KeyValuePairUtil.Create(p.name, p.value)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (2)
175=> node.GetAnnotatedNodesAndTokens(annotationKind).Where(nt => nt.IsNode).Select(nt => nt.AsNode()!); 178=> node.GetAnnotatedNodesAndTokens(annotationKind).Where(nt => nt.IsToken).Select(nt => nt.AsToken());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (3)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePairUtil.Create(p.Value, p.Key)))) 30: this(forwardMap: ImmutableDictionary.CreateRange(keyComparer, pairs.Select(static p => KeyValuePairUtil.Create(p.key, p.value))), 31backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePairUtil.Create(p.value, p.key))))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
25.Select(f => f.ConstantValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
83return new ValueTask<T[]>(Task.WhenAll(taskArray.Select(task => task.AsTask())));
Microsoft.CodeAnalysis.CodeStyle.Fixes (18)
Host\Mef\CodeStyleHostLanguageServices.cs (1)
56=> _compositionContext.GetExports<TExtension>().Select(e => new Lazy<TExtension>(() => e));
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
221return referencedSymbols.Select(referencedSymbol => referencedSymbol.Definition)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
146return paramNodes.Select(GetNameAttributes) 148.Any(nameAttributes => nameAttributes.Select(GetValueFromNameAttribute).Contains(name));
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
211return string.Join(newLineText, lines.Select(line =>
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (2)
176var isFixed = reservedNames.Select(s => true).Concat( 177arguments.Select(a => a.IsNamed)).ToImmutableArray();
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
279var memberDeclarations = GetDiagnosticsGroupedByMember(diagnostics, syntaxFacts, root).Select(g => g.Key); 328diagnosticId, diagnosticsToFix.Select(d => d),
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
79foreach (var projectId in solution.Projects.Select(p => p.Id))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
457members.OfType<INamedTypeSymbol>().Select(n => n.ToCodeGenerationSymbol()).ToImmutableArray(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
120.Select(n => (syntaxnode: n, namespaceSymbol: GetExplicitNamespaceSymbol(n, model)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
508.Select(field => field.AssociatedSymbol ?? field)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
83return GenerateUniqueName(baseName, filteredCandidates.Select(s => s.Name).Concat(usedNames));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
42.Select(lz => (lazyService: lz, usesFactory: false)); 44.Select(lz => (lazyService: new Lazy<ILanguageService, LanguageServiceMetadata>(() => lz.Value.CreateLanguageService(this), lz.Metadata), usesFactory: true));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (2)
46.Select(lz => (lz, usesFactory: false)); 48.Select(lz => (new Lazy<IWorkspaceService, WorkspaceServiceMetadata>(() => lz.Value.CreateService(this), lz.Metadata), usesFactory: true));
Microsoft.CodeAnalysis.Collections.Package (2)
ImmutableSegmentedDictionary.cs (1)
81.AddRange(source.Select(element => new KeyValuePair<TKey, TValue>(keySelector(element), elementSelector(element))));
ImmutableSegmentedListExtensions.cs (1)
114return Enumerable.Select(immutableList, selector);
Microsoft.CodeAnalysis.CSharp (17)
Binder\DecisionDagBuilder.cs (1)
1683var remainingValues = state.RemainingValues.Select(kvp => $"{tempName(kvp.Key)}:{kvp.Value}");
Binder\PatternExplainer.cs (1)
585var propertyString = needsPropertyString ? (deconstruction != null ? " {" : "{") + string.Join(", ", properties.Select(kvp => $" {kvp.Key.Name}: {kvp.Value}")) + " }" : null;
CommandLine\CSharpCommandLineParser.cs (1)
710metadataReferences.AddRange(ParseSeparatedPaths(value).Select(path => new CommandLineReference(path, MetadataReferenceProperties.Module)));
Compilation\CSharpCompilation.cs (1)
3697SourceAssembly.Modules.Skip(1).Select(m => m.Name), //all modules except the first one
Compiler\MethodCompiler.cs (1)
1664.Select(f => ((FieldSymbolAdapter)f).AdaptedFieldSymbol)
FlowAnalysis\CSharpDataFlowAnalysis.cs (1)
397return ImmutableArray.CreateRange(data.Where(s => s.CanBeReferencedByName).OrderBy(s => s, LexicalOrderSymbolComparer.Instance).Select(p => p.GetPublicSymbol()));
FlowAnalysis\NullableWalker.cs (1)
161return $$"""Collection: {{string.Join(", ", NestedVisitResults.Select(r => r.GetDebuggerDisplay()))}}""";
SourceGeneration\CSharpGeneratorDriver.cs (1)
51=> Create(incrementalGenerators.Select(GeneratorExtensions.AsSourceGenerator), additionalTexts: null);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (1)
465var members = string.Join(", ", symbol.GetMembers().OfType<IPropertySymbol>().Select(CreateAnonymousTypeMember));
Symbols\PublicModel\AssemblySymbol.cs (1)
59return UnderlyingAssemblySymbol.GetAllTopLevelForwardedTypes().Select(t => t.GetPublicSymbol()).
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
879uniqueUsings.AddAll(globalUsingNamespacesOrTypes.Where(n => n.UsingDirectiveReference?.SyntaxTree != tree).Select(n => n.NamespaceOrType));
Symbols\SymbolExtensions.cs (1)
690return symbols.Select(p => p.GetPublicSymbol<ISymbol>());
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
120return capturedParameters.OrderBy(static pair => pair.Key.Ordinal).Select(static pair => pair.Value);
Syntax\SyntaxReplacer.cs (3)
98_nodeSet.Select(n => n.FullSpan).Concat( 99_tokenSet.Select(t => t.FullSpan).Concat( 100_triviaSet.Select(t => t.FullSpan))));
Utilities\ValueSetFactory.EnumeratedValueSet.cs (1)
175public override string ToString() => $"{(this._included ? "" : "~")}{{{string.Join(",", _membersIncludedOrExcluded.Select(o => o.ToString()))}{"}"}";
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
1214=> initializer is null ? s_emptyCollectionExpression : CollectionExpression([.. initializer.Expressions.Select(ExpressionElement)]);
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
209.Concat(existingSymbols.Select(s => s.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
126trivia.Select(t => t.ToFullString()).Do(s => sb.Append(s));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (2)
249=> field.Declaration.Variables.Select(v => semanticModel.GetRequiredDeclaredSymbol(v, cancellationToken)), 251=> eventField.Declaration.Variables.Select(v => semanticModel.GetRequiredDeclaredSymbol(v, cancellationToken)),
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (27)
src\Analyzers\CSharp\CodeFixes\AddAnonymousTypeMemberName\CSharpAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
42=> initializer.Initializers.Where(i => i.NameEquals != null).Select(i => i.NameEquals!.Name.Identifier.ValueText);
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (2)
132=> _invocationExpression.ArgumentList.Arguments.Select(a => DetermineParameterType(a, cancellationToken)).ToImmutableArray(); 138=> _invocationExpression.ArgumentList.Arguments.Select(a => false).ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
249return compilationUnit.Members.OfType<GlobalStatementSyntax>().Select(g => g.Statement).ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
66var expressions = dummyObjectCreation.ArgumentList.Arguments.Select(a => a.Expression);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
65var expressions = dummyObjectCreation.ArgumentList.Arguments.Select(a => a.Expression);
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
138arguments.Select(a => a.Expression),
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
117references.Select(node => currentRoot.GetCurrentNode(node)).ToImmutableArray());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ArgumentGenerator.cs (2)
24=> SyntaxFactory.ArgumentList([.. arguments.Select(GenerateArgument)]); 27=> SyntaxFactory.BracketedArgumentList([.. arguments.Select(GenerateArgument)]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
31.Select(a => TryGenerateAttribute(a, info)) 43.Select(a => TryGenerateAttributeDeclaration(a, target, info))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
121var updatedTokens = TokenList(tokens.Select(ReplaceUnterminatedConstruct));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
466newAttributeLists = attributeLists.Select(attrList => attrList == attributeList ? newAttributeList : attrList); 512var wrappedStatements = StatementGenerator.GenerateStatements(statements).Select(GlobalStatement).ToArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BaseNamespaceDeclarationSyntaxExtensions.cs (1)
27newUsings = newUsings.Select(u => u.WithAdditionalAnnotations(annotations)).ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
124[.. usings.Select(u => u.WithAdditionalAnnotations(annotations))]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (6)
61var isFixed = reservedNames.Select(s => true).Concat( 62arguments.Select(a => a.NameColon != null)).ToImmutableArray(); 65arguments.Select(a => semanticModel.GenerateNameForArgument(a, cancellationToken))).ToImmutableArray(); 84var isFixed = reservedNames.Select(s => true).Concat( 85arguments.Select(a => a.NameEquals != null)).ToImmutableArray(); 88arguments.Select(a => semanticModel.GenerateNameForArgument(a, cancellationToken))).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
130=> SyntaxFactory.TypeParameterList([.. typeParameterNames.Select(SyntaxFactory.TypeParameter)]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
600var instantiatedMethods = methods.Select(m => Instantiate(m, invocationTypes)).ToList(); 1387var types = InferTypeInEqualsValueClause(equalsValueClause).Select(t => t.InferredType);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
286var accessors = propertyDeclaration.AccessorList.Accessors.Select(RemoveThrowNotImplemented);
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\AbstractBuiltInCodeStyleDiagnosticAnalyzer\AbstractBuiltInCodeStyleDiagnosticAnalyzerTests.cs (1)
21var ids = Enumerable.Range(10, 20).Select(item => "IDE_" + item);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (20)
CommandLineTests.cs (17)
513AssertEx.Equal(new[] { "first.cs", "second.cs", "b.cs", "a.cs", "c.cs", "d.cs", "last.cs" }.Select(prependBasePath), resolvedSourceFiles); 515AssertEx.Equal(new[] { RuntimeEnvironment.GetRuntimeDirectory() }.Concat(new[] { @"x", @"..\goo", @"../bar", @"a b" }.Select(prependBasePath)), args.ReferencePaths.ToArray()); 1198Select((res) => res.Reference)); 1205Select((res) => res.Reference)); 1276Select((res) => res.Reference)); 1283Select((res) => res.Reference)); 1734Enum.GetValues(typeof(LanguageVersion)).Cast<LanguageVersion>().Select(v => v.ToDisplayString())); 1881.Select(v => v.ToDisplayString()); 2334new[] { "a.cs", "b.cs", "c.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2340new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2346new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2352new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2358new[] { "a,b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2364new[] { "a.txt", "a.cs", "b.cs", "c.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 8859AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8916AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8957AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order());
GeneratorDriverCacheTests.cs (1)
101private static GeneratorDriver[] GetDrivers(int count) => Enumerable.Range(0, count).Select(i => CSharpGeneratorDriver.Create(Array.Empty<ISourceGenerator>())).ToArray();
TouchedFileLoggingTests.cs (2)
234var expected = expectedReads.Select(s => s.ToUpperInvariant()).OrderBy(s => s); 238expected = expectedWrites.Select(s => s.ToUpperInvariant()).OrderBy(s => s);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
134parsedDocumentBeforePaste, new NormalizedSnapshotSpanCollection(snapshotBeforePaste, snapshotBeforePaste.Version.Changes.Select(c => c.OldSpan)));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (43)
ChangeSignature\RemoveParametersTests.cs (1)
380workspace.GetOpenDocumentIds().Select(id => workspace.GetTestDocument(id).GetTextView()).ToList();
CommentSelection\CSharpCommentSelectionTests.cs (1)
132SetupSelection(doc.GetTextView(), doc.SelectedSpans.Select(s => Span.FromBounds(s.Start, s.End)));
Completion\ArgumentProviders\ArgumentProviderOrderTests.cs (3)
31var actualOrder = orderedCSharpArgumentProviders.Select(x => x.Value.GetType()).ToArray(); 47string.Join(Environment.NewLine, expectedOrder.Select(x => x.FullName)), 48string.Join(Environment.NewLine, actualOrder.Select(x => x.FullName)));
Completion\CompletionProviders\CompletionProviderOrderTests.cs (3)
32var actualOrder = orderedCSharpCompletionProviders.Select(x => x.Value.GetType()).ToArray(); 79string.Join(Environment.NewLine, expectedOrder.Select(x => x.FullName)), 80string.Join(Environment.NewLine, actualOrder.Select(x => x.FullName)));
Completion\CompletionProviders\ConversionCompletionProviderTests.cs (2)
454AssertEx.SetEqual(items.Select(i => i.DisplayText), toTypes); 516AssertEx.SetEqual(items.Select(i => i.DisplayText), expected);
Completion\CompletionProviders\DeclarationNameCompletionProviderTests.cs (7)
1174items.Select(item => item.DisplayText)); 2947styles.Select(t => t.specification).ToImmutableArray(), 2948styles.Select(t => t.style).ToImmutableArray(), 2949styles.Select(t => CreateRule(t.specification, t.style)).ToImmutableArray()); 2981specificationStyles.Select(t => t.specification).ToImmutableArray(), 2982specificationStyles.Select(t => t.style).ToImmutableArray(), 2983specificationStyles.Select(t => CreateRule(t.specification, t.style)).ToImmutableArray());
Completion\CompletionProviders\ExtensionMethodImportCompletionProviderTests.cs (6)
55=> (new[] { ReferenceType.None, ReferenceType.Project, ReferenceType.Metadata }).Select(refType => new[] { (object)refType }); 58=> CombineWithReferenceTypeData((new[] { "class", "struct", "interface", "enum", "abstract class" }).Select(kind => new List<object>() { kind })); 496}).Select(tuple => new List<object>() { tuple })); 535=> CombineWithReferenceTypeData((new[] { "class", "interface", "abstract class" }).Select(kind => new List<object>() { kind })); 584}).Select(tuple => new List<object>() { tuple })); 631}).Select(tuple => new List<object>() { tuple }));
Debugging\ProximityExpressionsGetterTests.cs (1)
96{string.Join(Environment.NewLine, body.ReplaceLineEndings("\n").Split('\n').Select(line => line == "" ? line : $" {line}"))}
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
803diagnostics.Verify(expectedDiagnostics.Select(d => d.diagnostic).ToArray());
EncapsulateField\EncapsulateFieldCommandHandlerTests.cs (1)
207workspace.GetOpenDocumentIds().Select(id => workspace.GetTestDocument(id).GetTextView()).ToList();
ExtractInterface\ExtractInterfaceTests.cs (1)
1453workspace.GetOpenDocumentIds().Select(id => workspace.GetTestDocument(id)!.GetTextView()).ToList();
ExtractMethod\ExtractMethodTests.cs (1)
11378workspace.GetOpenDocumentIds().Select(id => workspace.GetTestDocument(id)!.GetTextView()).ToList();
Interactive\BraceMatching\InteractiveBraceHighlightingTests.cs (10)
62Assert.True(result.Select(ts => ts.Span.Span).SetEquals(Enumerable(Span.FromBounds(15, 16), Span.FromBounds(18, 19)))); 74Assert.True(result.Select(ts => ts.Span.Span).SetEquals(Enumerable(Span.FromBounds(15, 16), Span.FromBounds(18, 19)))); 86Assert.True(result.Select(ts => ts.Span.Span).SetEquals(Enumerable(Span.FromBounds(35, 36), Span.FromBounds(36, 37)))); 94Assert.True(result.Select(ts => ts.Span.Span).SetEquals( 115Assert.True(result.Select(ts => ts.Span.Span).SetEquals(Enumerable(Span.FromBounds(42, 43), Span.FromBounds(44, 45)))); 119Assert.True(result.Select(ts => ts.Span.Span).SetEquals(Enumerable(Span.FromBounds(42, 43), Span.FromBounds(44, 45)))); 171AssertEx.Equal(Enumerable(new Span(62, 1), new Span(71, 1)), result.Select(ts => ts.Span.Span).OrderBy(s => s.Start)); 183AssertEx.Equal(Enumerable(new Span(62, 1), new Span(71, 1)), result.Select(ts => ts.Span.Span).OrderBy(s => s.Start)); 187AssertEx.Equal(Enumerable(new Span(82, 1), new Span(138, 1)), result.Select(ts => ts.Span.Span).OrderBy(s => s.Start)); 199AssertEx.Equal(Enumerable(new Span(82, 1), new Span(138, 1)), result.Select(ts => ts.Span.Span).OrderBy(s => s.Start));
MoveToNamespace\MoveToNamespaceTests.cs (1)
1456foreach (var id in workspace.Documents.Select(d => d.Id))
Organizing\OrganizeTypeDeclarationTests.cs (1)
1180workspace.GetOpenDocumentIds().Select(id => workspace.GetTestDocument(id).GetTextView()).ToList();
QuickInfo\SyntacticQuickInfoSourceTests.cs (1)
574var actualText = string.Concat(textElement.Runs.Select(r => r.Text));
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
1425AssertEx.SetEqual(workspace.Projects.SelectMany(p => p.Documents).Select(d => d.Id), eventArgs.Select(e => e.DocumentId));
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (1)
362var children = element.Nodes().Select(RemoveSequenceNode);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (36)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
4215var types = metadataReader.TypeDefinitions.Select(t => metadataReader.GetString(metadataReader.GetTypeDefinition(t).Name));
CodeGen\CodeGenCapturing.cs (4)
64.Select(list => list == null ? null : new List<string>(list))); 289.Select(x => x == null 403Enumerable.Range(0, totalLocalFuncs).Select(f => $"Local_{f}()")); 442string.Join("\r\n", fields.Select(f => $"public int {f} = 0;"))));
CodeGen\CodeGenDeconstructTests.cs (4)
2396var tuple = String.Join(", ", Enumerable.Range(1, i).Select(n => n.ToString())); 2397var variables = String.Join(", ", Enumerable.Range(1, i).Select(n => $"x{n}")); 2398var output = String.Join(@" + "" "" + ", Enumerable.Range(1, i).Select(n => $"x{n}")); 2399var expected = String.Join(" ", Enumerable.Range(1, i).Select(n => n));
CodeGen\CodeGenFunctionPointersTests.cs (1)
3340var addressOfs = declarators.Select(d => d.Initializer!.Value).ToArray();
CodeGen\CodeGenReadOnlySpanConstructionTest.cs (2)
2607string values = string.Join(", ", Enumerable.Range(1, numValues).Select(i => $"({typeName}){i}")); 2689string[] actual = Regex.Matches(il, @"\.class nested assembly explicit ansi sealed '([^']*?)'").Cast<Match>().Select(m => m.Groups[1].Value).ToArray();
CodeGen\CodeGenTupleTest.cs (15)
5883Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 5960Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 5979Assert.All(tupleWithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 5998Assert.All(tupleWithSomeNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6016Assert.All(tupleWithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6068Assert.All(tuple8WithoutNames.GetMembers().OfType<IFieldSymbol>().Where(f => f.Name != "Rest").Select(f => f.Locations.FirstOrDefault()), 6093Assert.All(tuple8WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6118Assert.All(tuple9WithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6144Assert.All(tuple9WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6176Assert.All(tuple9WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6200Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6925ImmutableArray.CreateRange(Enumerable.Range(0, n).Select(_ => annotation)); 22859AssertEx.SetEqual(xSymbol.GetMembers().OfType<IFieldSymbol>().Select(f => f.Name), 23995string filler = string.Join("\r\n", Enumerable.Range(1, 1000).Select(i => $"int y{i};")); 23996string parameters = string.Join(", ", Enumerable.Range(1, 2000).Select(i => $"int x{i}"));
CodeGen\DestructorTests.cs (4)
775Select(handle => new { handle = handle, row = peFileReader.GetTypeDefinition(handle) }). 787Select(handle => new { handle = handle, row = peFileReader.GetTypeReference(handle) }). 793Select(handle => new { handle = handle, row = peFileReader.GetMemberReference(handle) }). 799Select(handle => peFileReader.GetMethodImplementation(handle)).
CodeGen\IndexAndRangeTests.cs (1)
3857var receivers = tree.GetRoot().DescendantNodes().OfType<ElementAccessExpressionSyntax>().Select(e => e.Expression).ToArray();
Emit\CompilationEmitTests.cs (4)
3923AssertEx.SetEqual(expectedCMembers, actualCMembers.Select(s => s.Name)); 3946AssertEx.SetEqual(expectedAMembers, actualAMembers.Select(s => s.Name)); 3951AssertEx.SetEqual(expectedBMembers, actualBMembers.Select(s => s.Name)); 3956AssertEx.SetEqual(expectedCMembers, actualCMembers.Select(s => s.Name));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (11)
Emit\EditAndContinue\AssemblyReferencesTests.cs (1)
508AssertEx.Equal(expected, reader.GetAssemblyReferences().Select(aref => $"{reader.GetString(aref.Name)}, {aref.Version}"));
Emit\EditAndContinue\EditAndContinueStateMachineTests.cs (1)
2364diff1.VerifyPdb(Enumerable.Range(1, 20).Select(MetadataTokens.MethodDefinitionHandle), @"
Emit\EditAndContinue\EditAndContinueTests.cs (1)
12461Assert.Empty(pdbReader.CustomDebugInformation.Select(cdi => pdbReader.GetGuid(pdbReader.GetCustomDebugInformation(cdi).Kind)));
Emit\NumericIntPtrTests.cs (5)
11172var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11195var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11223var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11248var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11293var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
PDB\PDBTests.cs (1)
431.Select(i => $"""
PDB\PortablePdbTests.cs (2)
192AssertEx.Equal(new[] { "goo.cs" }, mdReader.Documents.Select(doc => mdReader.GetString(mdReader.GetDocument(doc).Name))); 253AssertEx.Equal(new[] { "goo.cs" }, mdReader.Documents.Select(doc => mdReader.GetString(mdReader.GetDocument(doc).Name)));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (36)
Attributes\AttributeTests_Conditional.cs (1)
212Select(a => a.AttributeClass.Name);
Attributes\AttributeTests_NativeInteger.cs (1)
1614var actualNames = handles.Select(h => GetAttributeConstructorName(reader, h)).ToArray();
Attributes\AttributeTests_Nullable.cs (7)
4749var fieldDefs = typeDef.GetFields().Select(f => reader.GetFieldDefinition(f)).ToArray(); 4868var field = typeDef.GetFields().Select(f => reader.GetFieldDefinition(f)).Single(f => reader.StringComparer.Equals(f.Name, "Field")); 4871var @event = typeDef.GetEvents().Select(e => reader.GetEventDefinition(e)).Single(e => reader.StringComparer.Equals(e.Name, "Event")); 4874var method = typeDef.GetMethods().Select(m => reader.GetMethodDefinition(m)).Single(m => reader.StringComparer.Equals(m.Name, "Method")); 4875var parameters = method.GetParameters().Select(p => reader.GetParameter(p)).ToArray(); 4879var property = typeDef.GetProperties().Select(p => reader.GetPropertyDefinition(p)).Single(p => reader.StringComparer.Equals(p.Name, "Property")); 5423var actualNames = handles.Select(h => GetAttributeConstructorName(reader, h)).ToArray();
Diagnostics\DiagnosticAnalyzerTests.cs (3)
353var diagIds = new HashSet<string>(diags.Select(d => d.Id)); 1708var files = compilation.SyntaxTrees.Select(t => t.FilePath).ToImmutableArray(); 4153var syntaxKinds = baseListNode.DescendantNodesAndSelf().Select(node => node.Kind()).Distinct().AsImmutable();
Diagnostics\GetDiagnosticsTests.cs (9)
1632AssertEx.SetEqual(expectedSymbolCallbacks, analyzer.AnalyzedSymbols.Select(s => s.Name).ToHashSet()); 1637AssertEx.SetEqual(expectedSyntaxNodeCallbacks, analyzer.AnalyzedSyntaxNodes.Select(s => s.ToString()).ToHashSet()); 1641AssertEx.SetEqual(expectedSyntaxNodeInsideBlockCallbacks, analyzer.AnalyzedSyntaxNodesInsideCodeBlock.Select(s => s.ToString()).ToHashSet()); 1646AssertEx.SetEqual(expectedOperationCallbacks, analyzer.AnalyzedOperations.Select(op => op.Syntax.ToString()).ToHashSet()); 1650AssertEx.SetEqual(expectedOperationInsideBlockCallbacks, analyzer.AnalyzedOperationsInsideOperationBlock.Select(op => op.Syntax.ToString()).ToHashSet()); 1662AssertEx.SetEqual(expectedBlockSymbolCallbacks, actualBlockSymbolCallbacks.Select(s => s.Name).ToHashSet()); 1667AssertEx.SetEqual(expectedSymbolStartSymbolCallbacks, analyzer.AnalyzedSymbolStartSymbols.Select(s => s.Name).ToHashSet()); 1669AssertEx.SetEqual(expectedSymbolStartSymbolCallbacks, analyzer.AnalyzedSymbolEndSymbols.Select(s => s.Name).ToHashSet()); 1673AssertEx.SetEqual(expectedSemanticModelTreeCallbacks, analyzer.AnalyzedSemanticModels.Select(s => s.SyntaxTree).ToHashSet());
FieldKeywordTests.cs (2)
1275var attributeArguments = tree.GetRoot().DescendantNodes().OfType<AttributeArgumentSyntax>().Select(arg => arg.Expression).ToArray(); 1333var attributeArguments = tree.GetRoot().DescendantNodes().OfType<AttributeArgumentSyntax>().Select(arg => arg.Expression).ToArray();
FlowAnalysis\FlowTestBase.cs (1)
234return symbols.Any() ? string.Join(", ", symbols.Select(symbol => symbol.Name)) : null;
OverloadResolutionPriorityTests.cs (1)
2585.Select(i => model.GetSymbolInfo(i).Symbol)
RefReadonlyParameterTests.cs (4)
7102var docComment = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single(); 7103var cref = docComment.DescendantNodes().OfType<XmlCrefAttributeSyntax>().Select(attr => attr.Cref).Single(); 7130var docComment = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single(); 7131var cref = docComment.DescendantNodes().OfType<XmlCrefAttributeSyntax>().Select(attr => attr.Cref).Single();
Semantics\PatternMatchingTests.cs (2)
4922var tasks = Enumerable.Range(0, numTasks).Select(t => Task.Run(() => 5017return string.Join(", ", Enumerable.Range(0, r.Next(3)).Select(i => $"{(propNames ? $"P{r.Next(10)}: " : null)}{Pattern(d)}"));
Semantics\PatternMatchingTests3.cs (2)
7269{Enumerable.Range((int)'A', (int)('z' - 'A') + 1).Select(x => (char)x) 7290{Enumerable.Range((int)'A', (int)('z' - 'A') + 1).Select(x => (char)x)
Semantics\PrimaryConstructorTests.cs (1)
6090var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single();
Semantics\RecordTests.cs (2)
28231var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().First(); 28388var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Microsoft.CodeAnalysis.CSharp.Features (42)
ChangeSignature\CSharpChangeSignatureService.cs (2)
719var newArguments = PermuteArguments(declarationSymbol, arguments.Select(a => UnifiedArgumentSyntax.Create(a)).ToImmutableArray(), 738arguments.Select(a => UnifiedArgumentSyntax.Create(a)).ToImmutableArray(),
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
263return root.GetAnnotatedNodesAndTokens(ReferenceAnnotation).Select(n => (IdentifierNameSyntax)n.AsNode()).ToImmutableArray();
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (2)
209.Select(a => a.NameColon!.Name.Identifier.ValueText); 213.Select(a => a.NameEquals!.Name.Identifier.ValueText);
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
300var currentParameterNames = baseMethod.ParameterList.Parameters.Select(p => p.Identifier.ValueText).ToImmutableHashSet();
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
145.Select(a => a.NameColon!.Name.Identifier.ValueText);
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (2)
180.Select(b => b.Left) 182.Select(i => i.Identifier.ValueText)];
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
77var alreadyTestedMembers = new HashSet<string>(propertyPatternClause.Subpatterns.Select(
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (3)
253attributeNames = attributes.Select(GetAttributeName).ToSet(); 347=> syntax.Content.Select(GetElementName).WhereNotNull(); 361.Select(GetAttributeValue));
ConvertAnonymousType\CSharpConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
69=> new(list.Select(CreateArgumentOrComma));
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (2)
79[.. identifiers.Select( 84[.. identifiers.Select(SingleVariableDesignation)]));
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
3061: OneOrMany.Create(declaration.Variables.Select(static v => (SyntaxNode?)v.Initializer?.Value).WhereNotNull().ToImmutableArray()); 3065=> DeclareSameIdentifiers(oldVariables.Select(v => v.Identifier).ToArray(), newVariables.Select(v => v.Identifier).ToArray());
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
147return declarators.Select(d => semanticModel.GetDeclaredSymbol(d, cancellationToken) as IFieldSymbol)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs (1)
74GlobalStatementSyntax globalStatement => ((CompilationUnitSyntax)globalStatement.Parent).Members.OfType<GlobalStatementSyntax>().Select(globalStatement => globalStatement.Statement),
GenerateType\CSharpGenerateTypeService.cs (1)
739.Select(n => n.Name.ToString())
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
388allAffectedStatements = allAffectedStatements.Select(root.GetCurrentNode).ToSet(); 440var localFunctionIdentifiers = localFunctions.Select(node => ((LocalFunctionStatementSyntax)node).Identifier.ValueText);
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
165return [.. members.Select(m => AddNullableRegions(m, cancellationToken))];
SignatureHelp\SignatureHelpUtilities.cs (4)
38list => list.Arguments.Select(argument => argument.NameColon?.Name.Identifier.ValueText); 40list => list.Arguments.Select(a => (string?)null); 42e => e.Expressions.Select(a => (string?)null); 44list => list.Arguments.Select(
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (2)
29private static readonly Func<TupleExpressionSyntax, IEnumerable<string>> s_getArgumentNames = e => e.Arguments.Select(a => a.NameColon?.Name.Identifier.ValueText ?? string.Empty); 157var items = tupleTypes.Select(tupleType => Convert(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
1214=> initializer is null ? s_emptyCollectionExpression : CollectionExpression([.. initializer.Expressions.Select(ExpressionElement)]);
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
209.Concat(existingSymbols.Select(s => s.Name))
src\Analyzers\CSharp\CodeFixes\AddAnonymousTypeMemberName\CSharpAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
42=> initializer.Initializers.Where(i => i.NameEquals != null).Select(i => i.NameEquals!.Name.Identifier.ValueText);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
225.Select(s =>
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (2)
132=> _invocationExpression.ArgumentList.Arguments.Select(a => DetermineParameterType(a, cancellationToken)).ToImmutableArray(); 138=> _invocationExpression.ArgumentList.Arguments.Select(a => false).ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
249return compilationUnit.Members.OfType<GlobalStatementSyntax>().Select(g => g.Statement).ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
66var expressions = dummyObjectCreation.ArgumentList.Arguments.Select(a => a.Expression);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
65var expressions = dummyObjectCreation.ArgumentList.Arguments.Select(a => a.Expression);
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
138arguments.Select(a => a.Expression),
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
117references.Select(node => currentRoot.GetCurrentNode(node)).ToImmutableArray());
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (8)
EditAndContinue\SyntaxComparerTests.cs (2)
159Enumerable.Range(0, 10000).Select(i => i < 2000 ? t1 : t2), 160Enumerable.Range(0, 10000).Select(i => i < 2000 ? t1 : t3));
EditAndContinue\SyntaxUtilitiesTests.cs (2)
258AssertEx.Equal(["yield return 1;"], SyntaxUtilities.GetSuspensionPoints(m1.Body).Select(n => n.ToString())); 270], SyntaxUtilities.GetSuspensionPoints(f.Body).Select(n => n.ToString()));
ExtractClass\ExtractClassTests.cs (2)
3085=> memberNames.Select(m => (m, true)); 3088=> memberNames.Select(m => (m, false));
SemanticSearch\CSharpSemanticSearchServiceTests.cs (1)
83AssertEx.Equal(["namespace N"], results.Select(Inspect));
src\Analyzers\CSharp\Tests\AbstractBuiltInCodeStyleDiagnosticAnalyzer\AbstractBuiltInCodeStyleDiagnosticAnalyzerTests.cs (1)
21var ids = Enumerable.Range(10, 20).Select(item => "IDE_" + item);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
CommandLineRunnerTests.cs (1)
770.Select(v => v.ToDisplayString());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (81)
Semantics\ConstantTests.cs (6)
2995var source = string.Join(Environment.NewLine, range.Select(i => 3025var source = string.Join(Environment.NewLine, range.Select(i => 3082var source = string.Join(Environment.NewLine, range.Select(i => 3112var source = string.Join(Environment.NewLine, range.Select(i => 3172var source = string.Join(Environment.NewLine, range.Select(i => 3205var source = string.Join(Environment.NewLine, range.Select(i =>
Semantics\DeconstructionTests.cs (2)
1481var tuple = String.Join(", ", Enumerable.Range(1, 22).Select(n => n.ToString())); 1482var variables = String.Join(", ", Enumerable.Range(1, 22).Select(n => $"x{n}"));
Semantics\DelegateTypeTests.cs (11)
3603var exprs = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => d.Initializer!.Value).ToArray(); 10393AssertEx.Equal(expectedInfo, variables.Select(v => getVariableInfo(model, v))); 11092var identifiers = nodes.OfType<InvocationExpressionSyntax>().Where(i => i.Expression is IdentifierNameSyntax id && id.Identifier.Text == "Report").Select(i => i.ArgumentList.Arguments[0].Expression).ToArray(); 13187var manyParams = string.Join(", ", range.Select(i => $"int p{i}")); 13188var manyArgs = string.Join(", ", range.Select(i => $"arg{i}: {i * 10}")); 13189var manyTypes = string.Join(",", range.Select(_ => "System.Int32")); 13208var fewArgs = string.Join(", ", range.Skip(1).Select(i => $"arg{i}: {i * 10}")); 13237var manyParams = string.Join(", ", range.Select(i => $"int p{i}")); 13238var manyTypes = string.Join(",", range.Select(_ => "System.Int32")); 13260var manyParams = string.Join(", ", range.Select(i => $"int p{i}")); 13261var manyTypes = string.Join(",", range.Select(_ => "System.Int32"));
Semantics\FunctionPointerTests.cs (8)
293foreach (var literal in tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(v => v.Initializer!.Value)) 600var decls = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => d.Initializer!.Value).ToList(); 839var decls = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => d.Initializer!.Value).ToList(); 2228.Select(s => model.GetSymbolInfo(s).CandidateSymbols.Single()) 2285.Select(s => 2358.Select(s => 3679.Select(m => m.ParameterList.Parameters.Single().Type!) 3952.Select(p => p.Type!)
Semantics\ImportsTests.cs (3)
142var trees = sources.Select(source => Parse(source)).ToArray(); 143var compilationUnits = trees.Select(tree => (CompilationUnitSyntax)tree.GetRoot()); 144var externAliases = compilationUnits.SelectMany(cu => cu.Externs).Select(e => e.Identifier.ValueText).Distinct();
Semantics\LambdaDiscardParametersTests.cs (1)
387var lambdas = exprs.Select(e => (IMethodSymbol)model.GetSymbolInfo(e).Symbol).ToArray();
Semantics\LambdaTests.cs (5)
3613var pairs = exprs.Select(e => (e, model.GetSymbolInfo(e).Symbol)).ToArray(); 3621AssertEx.Equal(expectedAttributes, pairs.Select(p => getAttributesInternal(p.Item1, p.Item2))); 3622AssertEx.Equal(expectedAttributes, pairs.Select(p => getAttributesPublic(p.Item1, p.Item2))); 3904var expectedAttributes = expectedAttributeNames.Select(n => comp.GetTypeByMetadataName(n)); 8012.Select(n => (Node: n, Symbol: (IMethodSymbol)model.GetSymbolInfo(n).Symbol))
Semantics\LocalFunctionTests.cs (5)
6489var exprs = tree.GetRoot().DescendantNodes().OfType<TypeOfExpressionSyntax>().Select(n => n.Type).ToImmutableArray(); 6536var exprs = tree.GetRoot().DescendantNodes().OfType<SizeOfExpressionSyntax>().Select(n => n.Type).ToImmutableArray(); 6553Select(n => n.ArgumentList.Arguments[0].Expression). 7039var actualSymbols = nodes.Select(n => model.GetSymbolInfo(n.Left).Symbol).Select(s => $"{s.Kind}: {s.ToTestDisplayString()}").ToArray(); 7099var actualSymbols = nodes.Select(n => model.GetDeclaredSymbol(n)).ToTestDisplayStrings();
Semantics\LookupTests.cs (4)
220var actual_lookupSymbols_as_string = actual_lookupSymbols.Select(e => e.ToString()); 323var actual_lookupSymbols_as_string = actual_lookupSymbols.Select(e => e.ToString()); 1229var actual_lookupSymbols_as_string = actual_lookupSymbols.Select(e => e.Name); 1353var actual_lookupSymbols_as_string = actual_lookupSymbols.Select(e => e.ToString()).ToList();
Semantics\NameOfTests.cs (1)
1247symbols.Select(s => s.GetPublicSymbol()),
Semantics\NativeIntegerTests.cs (6)
15316var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15337var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15360var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15388var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15411var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15441var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Semantics\NullableContextTests.cs (1)
2009var declarations = syntaxTree.GetRoot().DescendantNodes().OfType<FieldDeclarationSyntax>().Select(f => f.Declaration.Variables[0]).ToArray();
Semantics\NullableReferenceTypesTests.cs (1)
71780var discards = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Select(a => a.Left).ToArray();
Semantics\OperatorTests.cs (3)
3214.Select(x => x.Substring(x.IndexOf("//-", StringComparison.Ordinal) + 3).Trim()) 11419.Select(v => v.Initializer.Value) 11420.Select(i => model.GetOperation(i));
Semantics\OverloadResolutionTestBase.cs (1)
50.Select(x => x.Substring(x.IndexOf("//-", StringComparison.Ordinal) + 3))
Semantics\QueryTests.cs (1)
2358var symbols = unknownAccessorDecls.Select(decl => semanticModel.GetDeclaredSymbol(decl));
Semantics\RecordStructTests.cs (4)
3242var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single(); 3284var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 3332var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 3383var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Semantics\RefFieldTests.cs (5)
2269var actualFields = type.GetMembers().OfType<FieldSymbol>().Select(f => f.ToTestDisplayString()).ToList(); 11099var delegateTypesAndLambdas = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => getDelegateTypeAndLambda(model, d)).ToArray(); 12382Select(d => d.Designation).ToArray(); 12569Select(d => d.Designation).ToArray(); 25294var delegateTypesAndLambdas = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => getDelegateTypeAndLambda(model, d)).ToArray();
Semantics\ScriptSemanticsTests.cs (4)
420AssertEx.SetEqual(new[] { "<Initialize>", "G", ".ctor", "<Main>" }, methods.Select(m => m.Name)); 426AssertEx.SetEqual(new[] { "F", ".ctor" }, methods.Select(m => m.Name)); 522var statements = root.ChildNodes().Select(n => ((GlobalStatementSyntax)n).Statement).ToArray(); 538var declarations = root.ChildNodes().Select(n => ((FieldDeclarationSyntax)n).Declaration.Variables[0]).ToArray();
Semantics\UnsafeTests.cs (6)
5384Select(syntax => model.GetTypeInfo(syntax).Type).All(type => type.GetSymbol().IsManagedTypeNoUseSiteDiagnostics)); 10178var declaredSymbols = declarators.Select(syntax => (ILocalSymbol)model.GetDeclaredSymbol(syntax)).ToArray(); 10227var declaredSymbols = declarators.Select(syntax => (ILocalSymbol)model.GetDeclaredSymbol(syntax)).ToArray(); 10229var initializerSummaries = declarators.Select(syntax => model.GetSemanticInfoSummary(syntax.Initializer.Value)).ToArray(); 10255var accessSymbolInfos = dereferences.Select(syntax => model.GetSymbolInfo(((PrefixUnaryExpressionSyntax)syntax).Operand)).ToArray(); 10298var initializerSummaries = declarators.Select(syntax => model.GetSemanticInfoSummary(syntax.Initializer.Value)).ToArray();
SourceGeneration\GeneratorDriverTests.cs (1)
535var filePaths = outputCompilation.SyntaxTrees.Skip(1).Select(t => t.FilePath).ToArray();
SourceGeneration\SyntaxAwareGeneratorTests.cs (2)
696var classDeclarations = testReceiver.VisitedNodes.OfType<ClassDeclarationSyntax>().Select(c => c.Identifier.Text); 753var classDeclarations = testReceiver.VisitedNodes.OfType<ClassDeclarationSyntax>().Select(c => c.Identifier.Text);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (41)
Compilation\CompilationAPITests.cs (2)
2613Assert.All(type.GetMembers().OfType<IPropertySymbol>().Select(p => p.Locations.FirstOrDefault()), 2649Assert.All(type.GetMembers().OfType<IPropertySymbol>().Select(p => p.Locations.FirstOrDefault()),
Compilation\SemanticModelAPITests.cs (3)
843var typeA = mems.Where(s => s.Name == "A").Select(s => s); 845var invalid = mems.Where(s => s.Name == WellKnownMemberNames.TopLevelStatementsEntryPointTypeName).Select(s => s); 1200var args = descendants.OfType<ArgumentSyntax>().Where(s => s.ToString() == "index").Select(s => s);
DocumentationComments\CrefTests.cs (7)
3047var actualParameterTypes = nameMemberSyntax.Parameters.Parameters.Select(syntax => model.GetSymbolInfo(syntax.Type).Symbol).ToArray(); 4701var symbols = crefSyntaxes.Select(cref => model.GetSymbolInfo(cref).Symbol).ToArray(); 4757var symbols = crefSyntaxes.Select(cref => model.GetSymbolInfo(cref).Symbol).ToArray(); 6618var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 6619return docComments.SelectMany(docComment => docComment.DescendantNodes().OfType<XmlCrefAttributeSyntax>().Select(attr => attr.Cref)); 6647return crefs.Select(syntax => model.GetSymbolInfo(syntax).Symbol).Select(symbol => (object)symbol == null ? null : symbol.OriginalDefinition).ToArray();
DocumentationComments\DocumentationCommentCompilerTests.cs (1)
4656string[] includeElements = Enumerable.Range(0, 4).Select(i => string.Format(includeElementTemplate, xmlFilePath, i)).ToArray();
DocumentationComments\DocumentationModeTests.cs (3)
351var trees = AllModes.Select(mode => 380var trees = AllModes.Select(mode => 404var modes = Enumerable.Range((int)DocumentationMode.None, DocumentationMode.Diagnose - DocumentationMode.None + 1).Select(i => (DocumentationMode)i);
DocumentationComments\ParameterTests.cs (2)
841var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 842return docComments.SelectMany(docComment => docComment.DescendantNodes().OfType<XmlNameAttributeSyntax>().Select(attr => attr.Identifier));
SymbolDisplay\SymbolDisplayTests.cs (1)
8876var locals = decls.Select(d => model.GetDeclaredSymbol(d)).ToArray();
Symbols\CompilationCreationTests.cs (1)
55var types = expectedSyntaxTrees.Select(tree => compilation.GetSemanticModel(tree).GetDeclaredSymbol(tree.GetCompilationUnitRoot().Members.Single())).ToArray();
Symbols\FunctionPointerTypeSymbolTests.cs (5)
127.Select(p => p.Type!) 207.Select(p => p.Type!) 408.Select(p => p.Type!) 488.Select(p => p.Type!) 605.Select(p => p.Type!)
Symbols\IndexerTests.cs (2)
2634var receiverSyntaxes = elementAccessSyntaxes.Select(access => access.Expression); 2719var receiverSyntaxes = elementAccessSyntaxes.Select(access => access.Expression).ToArray();
Symbols\MethodEqualityTests.cs (1)
213var invokedMethods = stmts.Select(stmt =>
Symbols\Source\EventTests.cs (1)
43var actual = string.Join(", ", actualSymbols.Where(s => !s.IsImplicitlyDeclared).Select(symbol => symbol.Name).OrderBy(name => name));
Symbols\Source\ExternAliasTests.cs (2)
402var comp3 = CreateCompilation(Enumerable.Range(1, numFiles).Select(x => "extern alias X;").ToArray(), new[] { ref1, ref2 }, assemblyName: "A3.dll"); 428var comp3 = CreateCompilation(Enumerable.Range(1, numFiles).Select(x => "extern alias X;").ToArray(), assemblyName: "A3.dll");
Symbols\Source\NullablePublicAPITests.cs (9)
488members = e.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).Select(m => m.ReduceExtensionMethod(m.Parameters[0].Type)).ToArray(); 501var actualAnnotations = methods.Select(m => 570return syntaxTree.GetRoot().DescendantNodes().OfType<CSharp.Syntax.LocalFunctionStatementSyntax>().Select(func => semanticModel.GetDeclaredSymbol(func)).Cast<IMethodSymbol>().ToArray(); 946var actualAnnotations = invocations.Select(inv => 1003var actualAnnotations = variables.Select(v => 1066AssertEx.Equal(expectedNullabilities, members.Select(nullabilityFunc)); 2056var symbols = variable.DescendantNodes().OfType<SingleVariableDesignationSyntax>().Select(s => model.GetDeclaredSymbol(s)).Cast<ILocalSymbol>().ToList(); 2099var symbols = variable.DescendantNodes().OfType<SingleVariableDesignationSyntax>().Select(s => model.GetDeclaredSymbol(s)).Cast<ILocalSymbol>().ToList(); 4781var actualAnnotations = invocations.Select(inv => (((IMethodSymbol)model.GetSymbolInfo(inv).Symbol)).TypeArguments[0].NullableAnnotation).ToArray();
Symbols\TypeTests.cs (1)
1681var locals = localvars.OrderBy(s => s.Name).Select(s => s).ToArray();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (42)
Diagnostics\LineSpanDirectiveTests.cs (2)
246var actualVisibility = textB.Lines.Select(line => treeB.GetLineVisibility(line.Start)).ToImmutableArray(); 468return tree.GetLineMappings().Select(mapping => mapping.ToString()!).ToImmutableArray();
Diagnostics\LocationsTests.cs (1)
77return tree.GetLineMappings().Select(mapping => $"[|{text.GetSubText(text.Lines.GetTextSpan(mapping.Span))}|] -> {(mapping.IsHidden ? "<hidden>" : mapping.MappedSpan)}");
IncrementalParsing\IncrementalParsingTests.cs (2)
3107fullTree.GetDiagnostics().Select(d => d.ToString()), 3108incrTree.GetDiagnostics().Select(d => d.ToString()));
LexicalAndXml\DocumentationCommentLexerTestBase.cs (1)
69var baseline = actual.Select(ToExpectedTokenString);
LexicalAndXml\LexicalTests.cs (2)
3745.Select(SyntaxFacts.GetText) 3804return string.Join("", decimal.GetBits(d).Select(word => string.Format("{0:x8}", word)));
LexicalAndXml\RawStringLiteralLexingTests.cs (1)
224var actualDiagnosticsSpans = diagnostics.Select(d => d.Location.SourceSpan).OrderBy(d => d.Start);
Parsing\CollectionExpressionParsingTests.cs (1)
17096var text = $"[{string.Join(", ", Enumerable.Range(1, count).Select(i => $"A{i}"))}]";
Parsing\DeclarationParsingTests.cs (1)
2670var text = "class a { " + string.Join(" ", modifiers.Select(SyntaxFacts.GetText)) + " b X() { } }";
Parsing\ParsingErrorRecoveryTests.cs (7)
7399Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7418Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7451Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7476Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7501Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7527Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7551Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[]
Syntax\SyntaxAnnotationTests.cs (3)
255var annotations = new List<SyntaxAnnotation>(Enumerable.Range(0, 3).Select(_ => new SyntaxAnnotation())); 385var annotations = new List<SyntaxAnnotation>(Enumerable.Range(0, 10).Select(_ => new SyntaxAnnotation())); 666return root.DescendantNodesAndTokensAndSelf(descendIntoTrivia: true).Select(n => (SyntaxNodeOrToken)n).ToList();
Syntax\SyntaxEquivalenceTests.cs (2)
1292var expr = string.Join(" + ", Enumerable.Range(0, 10000).Select(_ => "a")); 1320var expr = string.Join(" + ", Enumerable.Range(0, 10000).Select(_ => "a"));
Syntax\SyntaxNodeTests.cs (17)
2046Assert.True(expectedTokenKinds.SequenceEqual(actualTokens.Select(t => t.Kind()))); 2067Assert.True(expectedTokenKinds.SequenceEqual(actualTokens.Select(t => (SyntaxKind)t.RawKind))); 2479var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2494var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2510var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2527var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2548var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2567var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2583var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2599var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2615var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2635var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2652var n = expr.DescendantTokens().Where(t => t.Text == "a").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2666var n = expr.DescendantTokens().Where(t => t.Text == "a").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2680var n = expr.DescendantTokens().Where(t => t.Text == "c").Select(t => t.Parent.FirstAncestorOrSelf<ArgumentSyntax>()).FirstOrDefault(); 2694var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<StatementSyntax>()).FirstOrDefault(); 2708var b = expr.DescendantTokens().Where(t => t.Text == "b").Select(t => t.Parent.FirstAncestorOrSelf<StatementSyntax>()).FirstOrDefault();
Syntax\SyntaxTests.cs (2)
310var returnedKindsInts = ((IEnumerable<SyntaxKind>)method.Invoke(null, null)).Select(static k => (int)k).ToHashSet(); 331var returnedKindsInts = SyntaxFacts.GetPreprocessorKeywordKinds().Select(static k => (int)k).ToHashSet();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
CSharpTestBase.cs (2)
1377Select(d => new DiagnosticDescription(d, errorCodeOnly: false, includeDefaultSeverity: false, includeEffectiveSeverity: false)).ToArray()); 1802return attributes.Select(a => a.ToString());
CSharpTestSource.cs (1)
60return sources.Select(source => Parse(source.Source, source.FileName, parseOptions)).ToArray();
EmitMetadataTestBase.cs (1)
110var actualPermissionSet = new string(actualPermissionSetBytes.Select(b => (char)b).ToArray());
Extensions.cs (1)
797return definition.Construct(typeArguments.Select(s => s.GetPublicSymbol()).ToArray());
MetadataTestHelpers.cs (1)
39mrefs: mrefs.Concat(compilations.Select(c => c.ToMetadataReference())).ToArray());
SymbolUtilities.cs (2)
113return types.Select(t => t.ToTestDisplayString()).ToArray(); 124return symbols.Select(s => s.ToDisplayString(format)).ToArray();
Microsoft.CodeAnalysis.CSharp.Workspaces (56)
CodeGeneration\CSharpSyntaxGenerator.cs (25)
115? [.. declarations.Select(this.AsUsingDirective).OfType<UsingDirectiveSyntax>()] 132? [.. declarations.Select(AsNamespaceMember).OfType<MemberDeclarationSyntax>()] 367baseConstructorArguments != null ? SyntaxFactory.ConstructorInitializer(SyntaxKind.BaseConstructorInitializer, SyntaxFactory.ArgumentList([.. baseConstructorArguments.Select(AsArgument)])) : null, 670=> accessorList.WithAccessors([.. accessorList.Accessors.Select(WithBody)]); 685=> accessorList?.WithAccessors([.. accessorList.Accessors.Select(WithoutBody)]); 709baseTypes.AddRange(interfaceTypes.Select(i => SyntaxFactory.SimpleBaseType((TypeSyntax)i))); 727? [.. members.Select(m => AsClassMember(m, className)).WhereNotNull()] 757var itypes = interfaceTypes?.Select(i => (BaseTypeSyntax)SyntaxFactory.SimpleBaseType((TypeSyntax)i)).ToList(); 778var itypes = interfaceTypes?.Select(i => (BaseTypeSyntax)SyntaxFactory.SimpleBaseType((TypeSyntax)i)).ToList(); 797? [.. members.Select(AsInterfaceMember).OfType<MemberDeclarationSyntax>()] 926=> members != null ? [.. members.Select(this.AsEnumMember)] : default; 957=> arguments != null ? SyntaxFactory.AttributeArgumentList([.. arguments.Select(AsAttributeArgument)]) : null; 990return attributes == null ? default : [.. attributes.Select(AsAttributeList)]; 1089.Select(list => list.WithTarget(SyntaxFactory.AttributeTargetSpecifier(ReturnKeyword))); 1094return [.. attributes.Select(list => list.WithTarget(SyntaxFactory.AttributeTargetSpecifier(AssemblyKeyword)))]; 1375=> members?.Select(m => AsMemberOf(declaration, m)).OfType<MemberDeclarationSyntax>(); 1831? SyntaxFactory.SeparatedList<TypeParameterConstraintSyntax>(types.Select(t => SyntaxFactory.TypeConstraint((TypeSyntax)t))) 2549=> SyntaxFactory.AccessorList([.. nodes.Select(n => AsAccessor(n, parentKind)).WhereNotNull()]); 2643return baseList.Types.OfType<SimpleBaseTypeSyntax>().Select(bt => bt.Type).ToReadOnlyCollection(); 2850newDeclarations = newDeclarations.Select(declaration => declaration is StatementSyntax statement ? SyntaxFactory.GlobalStatement(statement) : declaration); 2889newDeclarations = newDeclarations.Select(declaration => declaration is StatementSyntax statement ? SyntaxFactory.GlobalStatement(statement) : declaration); 3122=> nodes == null ? default : [.. nodes.Select(AsStatement)]; 3209=> [.. arguments.Select(AsArgument)]; 3560labels = labels.AddRange(expressions.Select(e => SyntaxFactory.CaseSwitchLabel((ExpressionSyntax)e))); 3610=> SyntaxFactory.TupleExpression([.. arguments.Select(AsArgument)]);
OrganizeImports\CSharpOrganizeImportsService.Rewriter.cs (1)
78=> string.Join(string.Empty, organizedList.Select(t => t.ToFullString()));
Rename\CSharpRenameRewriterLanguageService.cs (3)
817conflicts.AddRange(visitor.ConflictingTokens.Select(t => reverseMappedLocations[t.GetLocation()])); 831conflicts.AddRange(visitor.ConflictingTokens.Select(t => reverseMappedLocations[t.GetLocation()])); 841conflicts.AddRange(visitor.ConflictingTokens.Select(t => reverseMappedLocations[t.GetLocation()]));
Rename\LocalConflictVisitor.cs (4)
32var parameterTokens = node.ParameterList.Parameters.Select(p => p.Identifier); 76tokens.AddRange(node.Declaration.Variables.Select(v => v.Identifier)); 90tokens.AddRange(node.Declaration.Variables.Select(v => v.Identifier)); 121var tokens = node.ParameterList.Parameters.Select(p => p.Identifier);
Simplification\CSharpSimplificationService.Expander.cs (1)
178.Select(p => _semanticModel.GetDeclaredSymbol(p, _cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
126trivia.Select(t => t.ToFullString()).Do(s => sb.Append(s));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (2)
249=> field.Declaration.Variables.Select(v => semanticModel.GetRequiredDeclaredSymbol(v, cancellationToken)), 251=> eventField.Declaration.Variables.Select(v => semanticModel.GetRequiredDeclaredSymbol(v, cancellationToken)),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ArgumentGenerator.cs (2)
24=> SyntaxFactory.ArgumentList([.. arguments.Select(GenerateArgument)]); 27=> SyntaxFactory.BracketedArgumentList([.. arguments.Select(GenerateArgument)]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
31.Select(a => TryGenerateAttribute(a, info)) 43.Select(a => TryGenerateAttributeDeclaration(a, target, info))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
121var updatedTokens = TokenList(tokens.Select(ReplaceUnterminatedConstruct));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
466newAttributeLists = attributeLists.Select(attrList => attrList == attributeList ? newAttributeList : attrList); 512var wrappedStatements = StatementGenerator.GenerateStatements(statements).Select(GlobalStatement).ToArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (1)
143.Select(GenerateUsingDirective)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BaseNamespaceDeclarationSyntaxExtensions.cs (1)
27newUsings = newUsings.Select(u => u.WithAdditionalAnnotations(annotations)).ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
124[.. usings.Select(u => u.WithAdditionalAnnotations(annotations))]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (6)
61var isFixed = reservedNames.Select(s => true).Concat( 62arguments.Select(a => a.NameColon != null)).ToImmutableArray(); 65arguments.Select(a => semanticModel.GenerateNameForArgument(a, cancellationToken))).ToImmutableArray(); 84var isFixed = reservedNames.Select(s => true).Concat( 85arguments.Select(a => a.NameEquals != null)).ToImmutableArray(); 88arguments.Select(a => semanticModel.GenerateNameForArgument(a, cancellationToken))).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
130=> SyntaxFactory.TypeParameterList([.. typeParameterNames.Select(SyntaxFactory.TypeParameter)]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
600var instantiatedMethods = methods.Select(m => Instantiate(m, invocationTypes)).ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
286var accessors = propertyDeclaration.AccessorList.Accessors.Select(RemoveThrowNotImplemented);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (1)
2607var actualNames = actualNodes.Select(n => Generator.GetName(n)).ToArray();
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (1)
35return interpolation.Contents.OfType<InterpolatedStringTextSyntax>().Select(t => t.TextToken);
Microsoft.CodeAnalysis.EditorFeatures (21)
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (2)
35return TryUpdateAnalyzerConfigDocument(originalText, filePath, settingsToUpdate.Select(x => GetOptionValueAndLanguage(x.option, x.value))); 58return TryUpdateAnalyzerConfigDocument(originalText, filePath, settingsToUpdate.Select(x => GetOptionValueAndLanguage(x.option, x.value)));
Extensions\LSPExtensions.cs (2)
21=> new(element.Runs.Select(r => r.ToLSPRun())); 24=> new((Roslyn.Text.Adornments.ContainerElementStyle)element.Style, element.Elements.Select(ToLSPElement));
InlineRename\IEditorInlineRenameService.cs (1)
134return replacements.Select(r => r.Kind);
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (3)
230var trackingSpansAfterEdit = new NormalizedSpanCollection(GetEditableSpansForSnapshot(args.After).Select(ss => (Span)ss)); 231var spansTouchedInEdit = new NormalizedSpanCollection(args.Changes.Select(c => c.NewSpan)); 357.Select(document => (document, conflictResolution.GetReplacements(document.Id).Where(r => GetRenameSpanKind(r.Kind) != RenameSpanKind.None).ToImmutableArray()))
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (1)
586return session.CreateCompletionList(matchResults.Select(matchResult =>
Interactive\SendToInteractiveSubmissionProvider.cs (2)
72Select(span => new SnapshotSpan(snapshot, span.Start, span.Length)); 78=> string.Join(editorOptions.GetNewLineCharacter(), selectedSpans.Select(ss => ss.GetText()));
Logging\FunctionIdOptions.cs (1)
41=> GetFunctionIds().Select(GetOption);
Shared\Extensions\IProjectionBufferFactoryServiceExtensions.cs (1)
62spans.Select(s => s.TranslateTo(currentSnapshot, SpanTrackingMode.EdgeExclusive)));
Shared\Extensions\ITextViewExtensions.cs (2)
25textView.BufferGraph.GetTextBuffers(_ => true).Select(b => b.ContentType)); 107var spansInView = spans.Select(s => new Selection(textView.GetSpanInView(s).Single()));
Shared\Extensions\MefExtensions.cs (1)
47return extensions.SelectMatchingExtensions(contentTypes).Select(p => p.Value).ToList();
Shared\Utilities\LinkedEditsTracker.cs (4)
33=> _trackingSpans.Select(ts => ts.GetSpan(snapshot)).ToList(); 51var newTrackingSpans = snapshotSpanCollection.Select(ss => ss.Snapshot.CreateTrackingSpan(ss, SpanTrackingMode.EdgeInclusive, TrackingFidelityMode.Forward)); 66var trackingSpansAfterEdit = GetActiveSpansForSnapshot(args.After).Select(ss => (Span)ss).ToList(); 84var spansTouchedInEdit = new NormalizedSpanCollection(args.Changes.Select(c => c.NewSpan));
TextDiffing\EditorTextDifferencingService.cs (1)
42return diffResult.Differences.Select(d =>
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (13)
Classification\AbstractClassifierTests.cs (1)
298classificationsSpans.AddRange(allClassifications.Select(t => t.TextSpan));
Classification\FormattedClassification.cs (2)
55var type = string.Join("", parts.Select(Capitalize)); 213return $"{string.Join("", trimmedClassification.Split(' ').Select(Capitalize))}(\"{Text}\")";
CommentSelection\AbstractToggleCommentTestBase.cs (3)
38SetupSelection(doc.GetTextView(), doc.SelectedSpans.Select(s => Span.FromBounds(s.Start, s.End))); 55SetupSelection(document.GetTextView(), document.SelectedSpans.Select(s => Span.FromBounds(s.Start, s.End))); 76AssertEx.Equal(expectedSpans, textView.Selection.SelectedSpans.Select(snapshotSpan => TextSpan.FromBounds(snapshotSpan.Start, snapshotSpan.End)));
Completion\AbstractCompletionProviderTests.cs (1)
616Assert.Contains(itemToCommit, items.Select(x => x.DisplayText), GetStringComparer());
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
110Assert.False(testState.Workspace.Documents.Select(d => d.Id).Contains(result.NavigationDocumentId));
LanguageServer\AbstractLanguageServerProtocolTests.cs (1)
793internal ImmutableArray<SourceText> GetTrackedTexts() => GetManager().GetTrackedLspText().Values.Select(v => v.Text).ToImmutableArray();
QuickInfo\ToolTipAssert.cs (2)
206return string.Join(" Or ", stringValue.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(value => $"{nameof(ContainerElementStyle)}.{value}")); 212return string.Join(" Or ", stringValue.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(value => $"{nameof(ClassifiedTextRunStyle)}.{value}"));
SignatureHelp\AbstractSignatureHelpProviderTests.cs (1)
258=> string.Concat(list.Select(i => i.ToString()));
Structure\AbstractSyntaxStructureProviderTests.cs (1)
49var expectedRegions = expectedRegionData.Select(data => CreateBlockSpan(data, hostDocument.AnnotatedSpans)).ToArray();
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.TextBufferContainer.cs (1)
113var changes = ImmutableArray.CreateRange(args.Changes.Select(c => new TextChangeRange(new TextSpan(c.OldSpan.Start, c.OldSpan.Length), c.NewLength)));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (31)
CodeActions\CodeChangeProviderMetadataTests.cs (3)
78var providerNames = string.Join(", ", namedGroup.Select(exportedProvider => exportedProvider.Part.Definition.Type.FullName)); 123.Select(exportedProvider => TryGetExportName(exportedProvider.Export, out var name) ? name : string.Empty) 156.Select(field => (string)field.GetValue(null))
CodeFixes\ExtensionOrderingTests.cs (2)
130var expectedOrder = ExtensionOrderer.Order(langProviders).Select(lazy => lazy.Value).ToImmutableArray(); 137var actualOrder = codeFixPriorityMap.OrderBy(kvp => kvp.Value).Select(kvp => kvp.Key).ToImmutableArray();
CodeGeneration\CodeGenerationTests.cs (1)
910.Select(a => semanticModel.GetDeclaredSymbol(a))
CommentSelection\CommentUncommentSelectionCommandHandlerTests.cs (1)
776AssertEx.Equal(expectedSelectedSpans, textView.Selection.SelectedSpans.Select(snapshotSpan => snapshotSpan.Span));
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (2)
734string.Join(Environment.NewLine, baseline.Select(Inspect))); 748string.Join(Environment.NewLine, extraEntitiesBuilder.Select(Inspect)));
Diagnostics\IDEDiagnosticIDUniquenessTest.cs (1)
20var listOfIDEDiagnosticIds = type.GetFields().Select(x => x.GetValue(null).ToString()).ToList();
Structure\StructureTaggerTests.cs (1)
324var hints = tags.Select(x => x.GetCollapsedHintForm()).Cast<ViewHostingControl>().ToArray();
SymbolFinder\DependentTypeFinderTests.cs (5)
39projectReferences: projectReferences.Select(p => new ProjectReference(p))); 492AssertEx.SetEqual(immediateDerived.Select(d => d.Name), 500AssertEx.SetEqual(transitiveDerived.Select(d => d.Name), 545AssertEx.SetEqual(immediateImpls.Select(d => d.Name), 552AssertEx.SetEqual(transitiveImpls.Select(d => d.Name),
Tagging\AsynchronousTaggerTests.cs (2)
73.Select(i => new TagSpan<TextMarkerTag>(new SnapshotSpan(s.SnapshotSpan.Snapshot, new Span(50 + i * 2, 1)), new TextMarkerTag($"Test{i}"))), 85snapshot, Enumerable.Range(0, 101).Select(i => new Span(i * 4, 1)));
Tagging\TagSpanIntervalTreeTests.cs (6)
28spans.Select(s => new TagSpan<ITextMarkerTag>(new SnapshotSpan(buffer.CurrentSnapshot, s), new TextMarkerTag(string.Empty)))); 83var (tree, buffer) = CreateTree(new string('c', 100), Enumerable.Range(50, count: 50).Select(s => new Span(s, 1)).ToArray()); 97var (tree, buffer) = CreateTree(new string('c', 100), Enumerable.Range(0, count: 100).Select(s => new Span(s, 1)).ToArray()); 112var (tree, buffer) = CreateTree(new string('c', 100), Enumerable.Range(0, count: 100).Select(s => new Span(s, 1)).ToArray()); 126var (tree, buffer) = CreateTree(new string('c', 100), Enumerable.Range(0, count: 100).Select(s => new Span(s, 1)).ToArray()); 140var (tree, buffer) = CreateTree(new string('c', 100), Enumerable.Range(0, count: 100).Select(s => new Span(s, 1)).ToArray());
Utilities\BloomFilterTests.cs (3)
168var longs = CreateLongs(GenerateStrings(2000).Skip(500).Take(1000).Select(s => s.GetHashCode()).ToList()); 169var testLongs = CreateLongs(GenerateStrings(100000).Select(s => s.GetHashCode()).ToList()); 234var allCounts = allHashSets.Select(_ => new double[2]).ToArray();
ValueTracking\AbstractBaseValueTrackingTests.cs (2)
45Assert.True(itemInfo.Length == items.Length, $"GetTrackedItemsAsync\n\texpected: [{string.Join(",", itemInfo.Select(p => p.text))}]\n\t actual: [{string.Join(",", items)}]"); 58Assert.True(childInfo.Length == children.Length, $"GetTrackedItemsAsync on [{item}]\n\texpected: [{string.Join(",", childInfo.Select(p => p.text))}]\n\t actual: [{string.Join(",", children)}]");
Workspaces\ClassificationTypeNamesTests.cs (2)
23.Select(f => new[] { f.Name, f.GetRawConstantValue() }); 26f => f.GetValue(null) is string value).Select(f => new[] { f.GetValue(null) });
Microsoft.CodeAnalysis.EditorFeatures.Wpf (3)
Interactive\ResetInteractive.cs (1)
119var importNamespacesCommand = namespacesToImport.Select(_createImport).Join(editorOptions.GetNewLineCharacter());
Preview\AbstractPreviewTaggerProvider.cs (1)
52return intersection.Select(s => new TagSpan<TTag>(s, _tagInstance));
SignatureHelp\SignatureHelpControllerProvider.cs (1)
38private readonly IIntelliSensePresenter<ISignatureHelpPresenterSession, ISignatureHelpSession> _signatureHelpPresenter = ExtensionOrderer.Order(signatureHelpPresenters).Select(lazy => lazy.Value).FirstOrDefault();
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
PDB\MethodDebugInfo.Native.cs (1)
278return ImmutableArray.CreateRange(namespaces.Select(n => n.GetName()));
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (1)
FunctionResolverTestBase.cs (1)
69return ImmutableArray.CreateRange(handles.Select(h => reader.GetString(reader.GetGenericParameter(h).Name)));
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (24)
Debugger\Engine\DkmClrCustomTypeInfo.cs (1)
36private string DebuggerDisplay => $"[{string.Join(", ", Payload.Select(b => $"0x{b:x2}"))}] from {PayloadTypeId}";
Debugger\Engine\DkmClrModuleInstance.cs (1)
58var typeArgs = typeArguments.Select(t => ((TypeImpl)t.GetLmrType()).Type).ToArray();
Debugger\Engine\DkmClrRuntimeInstance.cs (2)
50this.Modules = assemblies.Select(a => getModule(this, a)).Where(m => m != null).ToArray(); 91result = result.MakeGenericType(typeArguments.Select(this.GetType).ToArray());
Debugger\Engine\DkmClrType.cs (2)
84_lmrType.MakeGenericType(genericArguments.Select(t => t._lmrType).ToArray()), 130: new ReadOnlyCollection<DkmClrType>(typeArgs.Select(t => DkmClrType.Create(AppDomain, t)).ToArray());
Debugger\Engine\DkmClrValue.cs (1)
279trimmedFormatSpecifiers.AddRange(rawFormatSpecifiers.Select(fs => fs.Trim()));
Debugger\MemberInfo\CustomAttributeDataImpl.cs (2)
37return CustomAttributeData.ConstructorArguments.Select(MakeTypedArgument).ToList(); 50var lmrValue = new ReadOnlyCollection<CustomAttributeTypedArgument>(reflectionValue.Select(MakeTypedArgument).ToList());
Debugger\MemberInfo\FieldInfoImpl.cs (1)
89return this.Field.GetCustomAttributesData().Select(a => new CustomAttributeDataImpl(a)).ToArray();
Debugger\MemberInfo\PropertyInfoImpl.cs (3)
87return this.Property.GetAccessors(nonPublic).Select(a => new MethodInfoImpl(a)).ToArray(); 107return this.Property.GetCustomAttributesData().Select(a => new CustomAttributeDataImpl(a)).ToArray(); 118return this.Property.GetIndexParameters().Select(p => new ParameterInfoImpl(p)).ToArray();
Debugger\MemberInfo\TypeImpl.cs (10)
133return Type.GetConstructors((System.Reflection.BindingFlags)bindingAttr).Select(c => new ConstructorInfoImpl(c)).ToArray(); 148return Type.GetCustomAttributesData().Select(a => new CustomAttributeDataImpl(a)).ToArray(); 174return Type.GetFields((System.Reflection.BindingFlags)flags).Select(f => new FieldInfoImpl(f)).ToArray(); 184return Type.GetGenericArguments().Select(t => new TypeImpl(t)).ToArray(); 194return Type.GetInterfaces().Select(i => new TypeImpl(i)).ToArray(); 204return Type.GetMember(name, (System.Reflection.BindingFlags)bindingAttr).Select(GetMember).ToArray(); 209return Type.GetMembers((System.Reflection.BindingFlags)bindingAttr).Select(GetMember).ToArray(); 235return this.Type.GetMethods((System.Reflection.BindingFlags)flags).Select(m => new MethodInfoImpl(m)).ToArray(); 295var interfaceMaps = Type.GetInterfaces().Select(i => Type.GetInterfaceMap(i)); 343return (TypeImpl)this.Type.MakeGenericType(argTypes.Select(t => ((TypeImpl)t).Type).ToArray());
ResultProviderTestBase.cs (1)
485return string.Join(" | ", parts.Select(p => enumTypeName + "." + p));
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Internal\Editor\Implementation\Debugging\FSharpBreakpointResolutionService.cs (1)
35=> (await _service.ResolveBreakpointsAsync(solution, name, cancellationToken).ConfigureAwait(false)).Select(r => r.UnderlyingObject);
Microsoft.CodeAnalysis.Features (43)
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (1)
37var assemblyNames = uniqueIdentities.Select(i => i.Name).ToSet();
AddPackage\InstallPackageDirectlyCodeActionOperation.cs (1)
53_projectsWithMatchingVersion.AddRange(otherProjects.Take(projectsToShow).Select(p => p.Name));
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
142.Select(changes => new TextSpan(changes.Key.Start, changes.Sum(change => change.NewText!.Length)));
CodeRefactorings\CodeRefactoringService.cs (1)
39new Lazy<ImmutableArray<CodeRefactoringProvider>>(() => ExtensionOrderer.Order(grp).Select(lz => lz.Value).ToImmutableArray())))));
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
92.Select(i => (foldername: string.Join(".", parts.Take(i)), index: i))
Common\TaggedText.cs (2)
217return string.Join(string.Empty, parts.Select( 222=> string.Join(string.Empty, parts.Select(p => p.ToString()));
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
46var items = symbols?.Select(s => CreateCompletionItem(s, syntaxContext));
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
82nonGlobalAliasedProjectReferencesSet.AddRange(currentProject.ProjectReferences.Where(pr => !HasGlobalAlias(pr.Aliases)).Select(pr => pr.ProjectId));
Completion\Providers\SymbolCompletionItem.cs (2)
239invalidProjects.Split(s_projectSeperators).Select(s => ProjectId.CreateFromSerialized(Guid.Parse(s))).ToList(), 240candidateProjects.Split(s_projectSeperators).Select(s => ProjectId.CreateFromSerialized(Guid.Parse(s))).ToList());
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
721=> new(list.Select(v => ConvertArgumentOrToken(generator, parameterNamingRule, isRecord, v)));
Debugging\AbstractBreakpointResolver.cs (1)
114Select(CreateBreakpoint).ToImmutableArrayOrEmpty();
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
1490activeNodesInLambdaBody = info.ActiveNodeIndices?.Select(i => memberBodyActiveNodes[i]) ?? [];
EditAndContinue\EmitSolutionUpdateResults.cs (1)
262.Select(static e => e.ProjectId)
EmbeddedLanguages\EmbeddedLanguageCommentDetector.cs (1)
49options = optionGroup.Captures.OfType<Capture>().Select(c => c.Value);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (1)
296.Select(p => p.Value.CreateIncrementalAnalyzer())
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingWorkItem.cs (1)
166=> $"{DocumentId?.ToString() ?? ProjectId.ToString()}, ({InvocationReasons}), LowPriority:{IsLowPriority}, ActiveMember:{ActiveMember != null}, Retry:{IsRetry}, ({string.Join("|", SpecificAnalyzers.Select(a => a.GetType().Name))})";
ExtractMethod\MethodExtractor.Analyzer.cs (1)
350string.Join(", ", failedVariables.Select(v => v.Name))));
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
322return new HashSet<SyntaxAnnotation>(annotations.Select(t => t.Item2));
FullyQualify\AbstractFullyQualifyService.cs (1)
178.Select(n => new SymbolResult(n,
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (1)
109let symbolTypes = parameters.Take(c.Parameters.Length).Select(p => p.Type)
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (2)
334.Select(parameterAndExpressionPair => (parameter: (ISymbol)parameterAndExpressionPair.Key, 342.Select(kvp => (parameter: kvp.Key, syntaxNode: syntaxGenerator.IdentifierName(kvp.Value)));
NavigateTo\NavigateToSearcher.cs (1)
467allProjectIdSet.AddRange(orderedProjects.SelectMany(x => x).Select(p => p.Id));
QuickInfo\QuickInfoServiceWithProviders.cs (1)
39.Select(lz => lz.Value)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
190var allReferenceDocuments = getReferencesByDocument.Concat(setReferencesByDocument).Select(g => g.Key).Distinct();
SignatureHelp\AbstractSignatureHelpProvider.cs (1)
213parameters.Select(p => ReplaceStructuralTypes(p, info, semanticModel, position)).Select(p => (SignatureHelpParameter)p),
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
217properties = properties.AddRange(tagIndices.Select(kvp => new KeyValuePair<string, string?>(kvp.Key, EncodeIndices(kvp.Value, additionalLocations.Count()))));
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
221return referencedSymbols.Select(referencedSymbol => referencedSymbol.Definition)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
146return paramNodes.Select(GetNameAttributes) 148.Any(nameAttributes => nameAttributes.Select(GetValueFromNameAttribute).Contains(name));
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
211return string.Join(newLineText, lines.Select(line =>
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
176var isFixed = reservedNames.Select(s => true).Concat(
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
279var memberDeclarations = GetDiagnosticsGroupedByMember(diagnostics, syntaxFacts, root).Select(g => g.Key); 328diagnosticId, diagnosticsToFix.Select(d => d),
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
79foreach (var projectId in solution.Projects.Select(p => p.Id))
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (1)
23return string.Join(s_separator, flattened.InnerExceptions.Select(e => GetExceptionMessage(e)));
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
648typeSymbol = typeSymbol.Construct(typeArguments.Select(t => t.Type).ToArray());
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (1)
174.Select(dependency => BuildReference(projectAssets, dependency, treatAsUsed: false, targetLibraryKeys, builtReferences))
UnusedReferences\UnusedReferencesRemover.cs (2)
49.Select(reference => reference.FilePath) 56.Select(reference => reference.Compilation.SourceModule.MetadataName)
ValueTracking\ValueTracker.OperationCollector.cs (1)
187.Select(argument => (collector: Clone(), argument))
Microsoft.CodeAnalysis.Features.Test.Utilities (8)
EditAndContinue\ActiveStatementTestHelpers.cs (1)
120=> updates.Select(InspectSequencePointUpdates);
EditAndContinue\EditAndContinueTestVerifier.cs (1)
516.Select(partners => new MatchingPair
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (2)
82=> CreateText("[*.*]" + Environment.NewLine + string.Join(Environment.NewLine, analyzerConfig.Select(c => $"{c.key} = {c.value}"))); 273var trees = sources.Select(source =>
EditAndContinue\RudeEditDiagnosticDescription.cs (1)
60string[] arguments = [formattedSquiggle, .. _arguments.Select(a => tryGetResource?.Invoke(a) is { } ? $"GetResource(\"{a}\")" : $"\"{a}\"")];
EditAndContinue\SourceMarkers.cs (2)
38=> sources.Select(Clear).ToArray(); 86=> ParseSpans(markedSource, tagName: "AS").Select(s => (s.span, s.id.major));
RelatedDocuments\AbstractRelatedDocumentsTests.cs (1)
48var expectedSortedResults = workspace.Documents.Where(d => d.SelectedSpans.Count > 0).Select(d => d.Id).OrderBy(d => d.Id);
Microsoft.CodeAnalysis.Features.UnitTests (3)
EditAndContinue\EmitSolutionUpdateResultsTests.cs (1)
53ModuleUpdates = new ModuleUpdates(ModuleUpdateStatus.Blocked, [.. updates.Select(CreateMockUpdate)]),
FindUsages\DefinitionItemFactoryTests.cs (2)
36=> string.Join(" | ", e.ToString().Split(',').Select(s => $"{typeof(TEnum).Name}.{s.Trim()}")); 65actual.Select(item => (key: item.Key, value: item.Value)).OrderBy(item => item.key),
Microsoft.CodeAnalysis.InteractiveHost (2)
Interactive\Core\InteractiveHost.Service.cs (2)
558metadataReferencePaths.AddRange(resolvedReferences.Where(r => r.FilePath != null).Select(r => r.FilePath!)); 731var directories = attemptedFilePaths.Select(path => Path.GetDirectoryName(path)).ToArray();
Microsoft.CodeAnalysis.LanguageServer (7)
BrokeredServices\Services\BrokeredServiceBridgeManifest\BrokeredServiceBridgeManifestService.cs (2)
45.Select(s => s.Key) 50_logger.LogDebug($"Proffered services: {string.Join(',', services.Select(s => s.ToString()))}");
ExportProviderBuilder.cs (1)
190var erroredParts = configuration.CompositionErrors.FirstOrDefault()?.SelectMany(error => error.Parts).Select(part => part.Definition.Type.Name) ?? Enumerable.Empty<string>();
HostWorkspace\ProjectTelemetry\ProjectLoadTelemetryReporter.cs (1)
153return projectFileInfos.Select(p => GetTargetFramework(p)?.ToLower()).WhereNotNull().ToImmutableArray();
LanguageServer\Handler\Restore\RestoreHandler.cs (1)
104.Select(p => p.FilePath)
Program.cs (1)
113.Select(f => f.FullName)
Testing\TestRunner.TestRunHandler.cs (1)
140var results = testRunChangedEventArgs.NewTestResults.Select(result =>
Microsoft.CodeAnalysis.LanguageServer.Protocol (18)
Extensions\ProtocolConversions.cs (3)
243return "file://" + string.Join("/", parts.Select(EscapeUriPart)); 249return "file://" + serverName + "/" + string.Join("/", parts.Skip(3).Select(EscapeUriPart)); 253return "file:///" + parts[0] + "/" + string.Join("/", parts.Skip(1).Select(EscapeUriPart));
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (2)
60.Select(kv => kv.Key.ProjectId) 62.Select(kv => kv.Key)));
Handler\CodeActions\CodeActionResolveHelper.cs (1)
289var edits = textChanges.Select(tc => new LSP.SumType<LSP.TextEdit, LSP.AnnotatedTextEdit>(ProtocolConversions.TextChangeToTextEdit(tc, oldText))).ToArray();
Handler\Diagnostics\BuildOnlyDiagnosticIdsHandler.cs (1)
45foreach (var languageName in context.Solution.Projects.Select(p => p.Language).Distinct())
Handler\Diagnostics\Public\PublicWorkspacePullDiagnosticsHandler.cs (1)
92return diagnosticsParams.PreviousResultId.Select(id => new PreviousPullResult
Handler\Diagnostics\WorkspacePullDiagnosticHandler.cs (1)
59=> diagnosticsParams.PreviousResults?.Where(d => d.PreviousResultId != null).Select(d => new PreviousPullResult(d.PreviousResultId!, d.TextDocument!)).ToImmutableArray();
Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
46edits.AddRange(textChanges.Select(change => ProtocolConversions.TextChangeToTextEdit(change, text)));
Handler\InlineCompletions\XmlSnippetParser.CodeSnippet.cs (1)
48_snippetTypes = snippetTypes.Elements().Select(e => e.Value.Trim()).ToArray();
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (1)
29=> requestParams.PreviousResults?.Where(d => d.PreviousResultId != null).Select(d => new PreviousPullResult(d.PreviousResultId!, d.TextDocument!)).ToImmutableArray();
Protocol\Converters\SumConverter.cs (2)
135.Select(p => p.ParameterType) 146.Select(p => p.ParameterType)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\AbstractLanguageServer.cs (2)
115var requestTypes = methodGroup.Select(m => m.RequestTypeRef); 116var responseTypes = methodGroup.Select(m => m.ResponseTypeRef);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
361await Task.WhenAll(concurrentlyExecutingTasksArray.Select(kvp => kvp.Key)).NoThrowAwaitable(captureContext: false);
Workspaces\LspWorkspaceManager.cs (1)
397.Select(uri => (identity: SourceGeneratedDocumentUri.DeserializeIdentity(workspaceCurrentSolution, uri), _trackedDocuments[uri].Text))
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
SpellCheck\SpellCheckTests.cs (1)
75var markup = string.Join(Environment.NewLine, Enumerable.Range(0, 5500).Select(v =>
Microsoft.CodeAnalysis.Rebuild (4)
CompilationFactory.cs (2)
85.Select(st => (path: st.FilePath, text: st.GetText())) 87.Select(pair => EmbeddedText.FromSource(pair.path, pair.text))
CompilationOptionsReader.cs (2)
173.Select(x => ResolveEmbeddedSource(x.DocumentHandle, x.SourceTextInfo)) 268var result = metadataReader.ManifestResources.Select(handle =>
Microsoft.CodeAnalysis.Rebuild.UnitTests (4)
BasicDeterministicKeyBuilderTests.cs (1)
182var parseOptions = VisualBasicParseOptions.Default.WithPreprocessorSymbols(values.Select(x => new KeyValuePair<string, object>(x.Key, x.Value!)));
CompilationRebuildArtifactResolver.cs (1)
31.Select(x => x.GetText())
DeterministicKeyBuilderTests.cs (1)
470.WithFeatures(features.Select(x => new KeyValuePair<string, string>(x.Key, x.Value)));
OptionRoundTripTests.cs (1)
33public static readonly object[][] Platforms = ((Platform[])Enum.GetValues(typeof(Platform))).Select(p => new[] { (object)p }).ToArray();
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Services\DiagnosticAnalyzer\PerformanceQueue.cs (3)
120var stddev = Math.Sqrt(data.Select(ms => Math.Pow(ms - average, 2)).Average()); 167var minSpan = rawData.Select(kv => kv.timeSpan).Min(); 182=> rawData.Select(kv => (AnalyzerNumberAssigner.Instance.GetUniqueNumber(kv.analyzerId), kv.timeSpan));
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (2)
TelemetryLoggerTests.cs (2)
67=> @event.Properties.Select(p => $"{p.Key}={(keyToIgnoreValueInspection == p.Key ? string.Empty : InspectPropertyValue(p.Value))}"); 73TelemetryComplexProperty { Value: IEnumerable<object?> items } => $"Complex[{string.Join(",", items.Select(InspectPropertyValue))}]",
Microsoft.CodeAnalysis.Scripting (4)
ScriptOptions.cs (1)
76return ImmutableArray.CreateRange(files.Select(CreateUnresolvedReference));
src\Compilers\Shared\GlobalAssemblyCacheHelpers\MonoGlobalAssemblyCache.cs (2)
141return GetAssemblyIdentitiesAndPaths(partialName, architectureFilter).Select(identityAndPath => identityAndPath.Item1); 162Select(identityAndPath => identityAndPath.Identity.Name).Distinct();
Utilities\ParameterValidationHelpers.cs (1)
73return items.Select(item => (item != null) ? selector(item) : null);
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (1)
MetadataShadowCopyProviderTests.cs (1)
152AssertEx.SetEqual(new[] { "MultiModule.dll", "mod2.netmodule", "mod3.netmodule" }, scFiles.Select(p => Path.GetFileName(p)));
Microsoft.CodeAnalysis.Test.Utilities (63)
Assert\AssertEx.cs (3)
546return string.Join(separator, list.Select(itemInspector)); 688var expectedString = string.Join(itemSeparator, expected.Take(10).Select(itemInspector)); 689var actualString = string.Join(itemSeparator, actual.Select(itemInspector));
Assert\AssertXml.cs (2)
253IEnumerable<Tuple<XName, string>> attributes1 = element1.Attributes().Select(MakeAttributeTuple); 254IEnumerable<Tuple<XName, string>> attributes2 = element2.Attributes().Select(MakeAttributeTuple);
Compilation\CompilationTestDataExtensions.cs (1)
72string.Join(Environment.NewLine, keys.Select(s => " " + s)) + Environment.NewLine);
Compilation\IRuntimeEnvironment.cs (2)
252.Select(t => (filePath: t.FilePath, text: t.GetText())) 254.Select(t => EmbeddedText.FromSource(t.filePath, t.text))
Compilation\OperationTreeVerifier.cs (1)
164var lines = text.Split(new[] { Environment.NewLine, "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).Select(l => l.Trim()).ToArray();
CompilationVerifier.cs (3)
81images.AddRange(_allModuleData.Where(m => m.Kind == OutputKind.NetModule).Select(m => m.Image)); 420return string.Join(Environment.NewLine, result.Select(r => printMethod(r.Method, metadataReader) + r.Message + printErrorArguments(r.ErrorArguments))); 445var x = errorArguments.Select(a => printErrorArgument(a)).ToArray();
Diagnostics\CommonDiagnosticAnalyzers.cs (7)
157" + String.Join("," + Environment.NewLine + " ", Descriptor1.CustomTags.Select(s => $"\"{s}\"")) + @" 171" + String.Join("," + Environment.NewLine + " ", Descriptor2.CustomTags.Select(s => $"\"{s}\"")) + @" 234" + String.Join("," + Environment.NewLine + " ", Descriptor1.CustomTags.Select(s => $"\"{s}\"")) + @" 248" + String.Join("," + Environment.NewLine + " ", Descriptor2.CustomTags.Select(s => $"\"{s}\"")) + @" 376" + string.Join("," + Environment.NewLine + " ", suppressionKinds.Select(s => $"\"{s}\"")) + @" 474" + string.Join("," + Environment.NewLine + " ", Descriptor1.CustomTags.Select(s => $"\"{s}\"")) + @" 495" + String.Join("," + Environment.NewLine + " ", Descriptor2.CustomTags.Select(s => $"\"{s}\"")) + @"
Diagnostics\DiagnosticExtensions.cs (1)
75var unmatchedActualDescription = actual.Select(d => new DiagnosticDescription(d, errorCodeOnly, includeDefaultSeverity, includeEffectiveSeverity))
Diagnostics\DiagnosticsHelper.cs (1)
27var actualDiagnosticIds = actualDiagnostics.Select(d => d.Id);
Diagnostics\ThrowingDiagnosticAnalyzer.cs (3)
100" Exceptions thrown by analyzers in these members were *NOT* handled:" + Environment.NewLine + string.Join(Environment.NewLine, membersHandled.Where(mh => mh.Handled == false).Select(mh => mh.Member)) + Environment.NewLine + Environment.NewLine + 101" Exceptions thrown from these members were handled gracefully:" + Environment.NewLine + string.Join(Environment.NewLine, membersHandled.Where(mh => mh.Handled == true).Select(mh => mh.Member)) + Environment.NewLine + Environment.NewLine + 102" These members were not called/accessed by analyzer engine:" + Environment.NewLine + string.Join(Environment.NewLine, membersHandled.Where(mh => mh.Handled == null).Select(mh => mh.Member)));
Diagnostics\TrackingDiagnosticAnalyzer.cs (6)
76var actualMembers = _callLog.Select(e => e.CallerName).Distinct(); 87var actualSymbolKinds = _callLog.Where(a => FilterByAbstractName(a, "Symbol")).Where(e => e.SymbolKind.HasValue).Select(e => e.SymbolKind.Value).Distinct(); 99var actualSyntaxKinds = new HashSet<TLanguageKindEnum>(_callLog.Where(a => FilterByAbstractName(a, "SyntaxNode")).Select(e => e.SyntaxKind)); 145.Select(e => new { SymbolKind = e.SymbolKind.Value, MethodKind = e.MethodKind ?? InvalidMethodKind, e.ReturnsVoid }).Distinct(); 147.Select(e => new { SymbolKind = e.SymbolKind.Value, MethodKind = e.MethodKind ?? InvalidMethodKind, e.ReturnsVoid }).Distinct(); 174.Where(p => p.IsMissing).Select(p => p.Element).ToList();
EncodingTestHelpers.cs (1)
42=> GetEncodings().Select(e => new object?[] { e });
Metadata\AggregatedMetadataReader.cs (1)
41Readers.SelectMany(r => r.AssemblyReferences.Select(h => r.GetAssemblyReference(h)));
Metadata\MetadataReaderUtils.cs (21)
104return handles.Select(handle => readers.GetString(handle)).ToArray(); 114return reader.AssemblyReferences.Select(handle => reader.GetAssemblyReference(handle).Name).ToArray(); 119return reader.TypeDefinitions.Select(handle => reader.GetTypeDefinition(handle).Name).ToArray(); 124return reader.TypeDefinitions.Select(handle => 133return reader.TypeReferences.Select(handle => reader.GetTypeReference(handle).Name).ToArray(); 138return reader.EventDefinitions.Select(handle => reader.GetEventDefinition(handle).Name).ToArray(); 143return reader.FieldDefinitions.Select(handle => reader.GetFieldDefinition(handle).Name).ToArray(); 148return reader.MethodDefinitions.Select(handle => reader.GetMethodDefinition(handle).Name).ToArray(); 153return reader.MemberReferences.Select(handle => reader.GetMemberReference(handle).Name).ToArray(); 158return reader.GetParameters().Select(handle => reader.GetParameter(handle).Name).ToArray(); 163return reader.PropertyDefinitions.Select(handle => reader.GetPropertyDefinition(handle).Name).ToArray(); 311return reader.AssemblyReferences.Select(r => reader.GetAssemblyReference(r)) 312.Select(row => $"{reader.GetString(row.Name)} {row.Version.Major}.{row.Version.Minor}"); 318.Select(t => reader.GetTypeReference(t)) 319.Select(t => $"{reader.GetString(t.Name)}, {reader.GetString(t.Namespace)}, {reader.Dump(t.ResolutionScope)}"); 470AssertEx.SetEqual(metadataReader.TypeDefinitions.Select(t => metadataReader.Dump(t)), types); 471AssertEx.SetEqual(metadataReader.MethodDefinitions.Select(t => metadataReader.Dump(t)), methods); 474metadataReader.CustomAttributes.Select(a => metadataReader.GetCustomAttribute(a).Constructor) 475.Select(c => metadataReader.GetMemberReference((MemberReferenceHandle)c).Parent) 476.Select(p => metadataReader.GetTypeReference((TypeReferenceHandle)p).Name) 477.Select(n => metadataReader.GetString(n)),
Mocks\MoqExtensions.cs (2)
17expectedInvocations.Select(i => $"{i.Name}: {string.Join(",", i.Args)}"), 18invocations.Select(i => $"{i.Method.Name}: {string.Join(",", i.Arguments)}"));
Mocks\TestMissingMetadataReferenceResolver.cs (1)
57AssertEx.Equal(expected, ResolutionAttempts.Select(a => a.ToString()));
Platform\CoreClr\CoreCLRRuntimeEnvironment.cs (1)
166return LoadContext.GetMemberSignaturesFromMetadata(fullyQualifiedTypeName, memberName, AllModuleData.Select(x => x.Id));
ReflectionAssert.cs (2)
19var fieldsAndProps = fields.Where(f => !f.IsPrivate).Select(f => f.Name).Concat( 20properties.Where(p => p.GetMethod != null && !p.GetMethod.IsPrivate).Select(p => p.Name)).
Syntax\TokenUtilities.cs (4)
55var expectedDisplay = string.Join(" ", expectedTokens.Select(t => t.ToString())); 56var actualDisplay = string.Join(" ", actualTokens.Select(t => t.ToString())); 76return CS.SyntaxFactory.ParseTokens(text).Select(t => (SyntaxToken)t).Where(t => !SkipCSharpToken(t)).ToList(); 80return VB.SyntaxFactory.ParseTokens(text).Select(t => (SyntaxToken)t).Where(t => !SkipVisualBasicToken(t)).ToList();
Microsoft.CodeAnalysis.UnitTests (66)
AnalyzerAssemblyLoaderTests.cs (3)
413.Select(x => (x.simpleName, x.version, getExpectedLoadPath(x.path))) 416assemblies.Select(assembly => (assembly.GetName().Name!, assembly.GetName().Version!.ToString(), assembly.Location)) 468.Select(x =>
Analyzers\AnalyzerConfigTests.cs (23)
205AnalyzerConfig.ReservedKeys.Select(k => "MY_" + k + " = MY_VAL"))); 207AnalyzerConfig.ReservedKeys.Select(k => KeyValuePair.Create("my_" + k, "MY_VAL")).ToList(), 353AnalyzerConfig.ReservedValues.Select(v => "MY_KEY" + (index++) + " = " + v.ToUpperInvariant()))); 356AnalyzerConfig.ReservedValues.Select(v => KeyValuePair.Create("my_key" + (index++), v)).ToList(), 364AnalyzerConfig.ReservedKeys.Select(k => k + " = MY_VAL"))); 366AnalyzerConfig.ReservedKeys.Select(k => KeyValuePair.Create(k, "my_val")).ToList(), 967}, options.Select(o => o.TreeOptions).ToArray()); 1017}, options.Select(o => o.TreeOptions).ToArray()); 1044}, options.Select(o => o.TreeOptions).ToArray()); 1066}, options.Select(o => o.TreeOptions).ToArray()); 1088}, options.Select(o => o.TreeOptions).ToArray()); 1112}, options.Select(o => o.TreeOptions).ToArray()); 1145}, options.Select(o => o.TreeOptions).ToArray()); 1167}, options.Select(o => o.TreeOptions).ToArray()); 1198}, options.Select(o => o.TreeOptions).ToArray()); 1218}, options.Select(o => o.TreeOptions).ToArray()); 1228return filePaths.Select(f => set.GetOptionsForSourcePath(f)).ToArray(); 1511}, options.Select(o => o.TreeOptions).ToArray()); 1541}, options.Select(o => o.TreeOptions).ToArray()); 1575}, options.Select(o => o.TreeOptions).ToArray()); 2057}, options.Select(o => o.TreeOptions).ToArray()); 2073var options = new[] { "/test.cs", "/path/to/file.cs" }.Select(f => set.GetOptionsForSourcePath(f)).ToArray(); 2134}, options.Select(o => o.TreeOptions).ToArray());
Analyzers\AnalyzerFileReferenceTests.cs (1)
156var failedTypes = errors.Where(e => e.ErrorCode == AnalyzerLoadFailureEventArgs.FailureErrorCode.UnableToCreateAnalyzer).Select(e => e.TypeName);
CachingLookupTests.cs (2)
123foreach (string k in look1.Select(g => g.Key)) 143foreach (string k in look2.Select(g => g.Key))
Collections\IdentifierCollectionTests.cs (2)
45AssertNotContains(idcol, strings.Select(s => s.ToUpper())); 62AssertContains(idcol, strings.Select(s => s.ToUpper()));
Collections\ImmutableDictionaryTestBase.nonnetstandard.cs (2)
91map = map.AddRange(Enumerable.Range(1, 100).Select(n => new KeyValuePair<int, GenericParameterHelper>(n, new GenericParameterHelper()))); 92CollectionAssertAreEquivalent(map.Select(kv => kv.Key).ToList(), Enumerable.Range(1, 100).ToList());
Collections\ImmutableListTestBase.cs (2)
450var basis = new List<int>(Enumerable.Range(1, 50).Select(n => n * 2)); 475var reverseSorted = System.Collections.Immutable.ImmutableArray.CreateRange(Enumerable.Range(1, 150).Select(n => n * 2).Reverse());
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (4)
97.AddRange(Enumerable.Range(1, 10).Select(n => new KeyValuePair<int, string?>(n, null))) 100Enumerable.Range(1, 10).Select(n => new KeyValuePair<int, string?>(n, null)), 109Enumerable.Range(1, 11).Select(n => new KeyValuePair<int, string?>(n, null)), 119Enumerable.Range(1, 11).Select(n => new KeyValuePair<int, string?>(n, null)),
Collections\ImmutableSegmentedListTest.cs (3)
61int[] values = Enumerable.Range(0, inputLength).Select(i => random.Next()).ToArray(); 75values = Enumerable.Range(0, inputLength).Select(i => random.Next()).ToArray(); 139var bulkList = ImmutableSegmentedList<int>.Empty.AddRange(Enumerable.Range(1, 10).Select(i => i * 10));
Collections\ImmutableSetTest.cs (3)
96Empty<int>().Except(Enumerable.Range(1, 1).Select(n => { enumerated = true; return n; })); 119this.SetCompareTestHelper(s => s.IsProperSupersetOf, s => s.IsProperSupersetOf, GetIsProperSubsetOfScenarios().Select(Flip)); 131this.SetCompareTestHelper(s => s.IsSupersetOf, s => s.IsSupersetOf, GetIsSubsetOfScenarios().Select(Flip));
Collections\List\SegmentedList.Generic.Tests.Misc.cs (1)
201.Select(item => item);
Collections\List\TestBase.Generic.cs (1)
313return list.Select(item => item);
Collections\SegmentedCollectionsMarshalTests.cs (18)
584test<Guid>(Enumerable.Range(0, 17).Select(_ => Guid.NewGuid())); 585test<Guid?>(Enumerable.Range(0, 17).Select(_ => (Guid?)Guid.NewGuid())); 586test<string>(Enumerable.Range(0, 17).Select(_ => Guid.NewGuid().ToString())); 587test<CustomClass>(Enumerable.Range(0, 17).Select(_ => new CustomClass())); 588test<ManagedCustomStruct>(Enumerable.Range(0, 17).Select(_ => new ManagedCustomStruct() { Bar = Guid.NewGuid() })); 589test<ManagedCustomStruct?>(Enumerable.Range(0, 17).Select(_ => (ManagedCustomStruct?)new ManagedCustomStruct() { Bar = Guid.NewGuid() })); 590test<UnmanagedCustomStruct>(Enumerable.Range(0, 17).Select(_ => new UnmanagedCustomStruct() { Foo = Guid.NewGuid() })); 591test<UnmanagedCustomStruct?>(Enumerable.Range(0, 17).Select(_ => (UnmanagedCustomStruct?)new UnmanagedCustomStruct() { Foo = Guid.NewGuid() })); 656test<Guid>(Enumerable.Range(0, 17).Select(_ => Guid.NewGuid())); 657test<Guid?>(Enumerable.Range(0, 17).Select(_ => (Guid?)Guid.NewGuid())); 658test<string>(Enumerable.Range(0, 17).Select(_ => Guid.NewGuid().ToString())); 659test<CustomClass>(Enumerable.Range(0, 17).Select(_ => new CustomClass())); 660test<ManagedCustomStruct>(Enumerable.Range(0, 17).Select(_ => new ManagedCustomStruct() { Bar = Guid.NewGuid() })); 661test<ManagedCustomStruct?>(Enumerable.Range(0, 17).Select(_ => (ManagedCustomStruct?)new ManagedCustomStruct() { Bar = Guid.NewGuid() })); 662test<UnmanagedCustomStruct>(Enumerable.Range(0, 17).Select(_ => new UnmanagedCustomStruct() { Foo = Guid.NewGuid() })); 663test<UnmanagedCustomStruct?>(Enumerable.Range(0, 17).Select(_ => (UnmanagedCustomStruct?)new UnmanagedCustomStruct() { Foo = Guid.NewGuid() })); 701SegmentedDictionary<int, TValue> dictionary = new SegmentedDictionary<int, TValue>(Enumerable.Range(0, 17).Select(x => new KeyValuePair<int, TValue>(x, createValue()))); 768ImmutableSegmentedDictionary<int, T> immutableDictionary = ImmutableSegmentedDictionary.CreateRange(Enumerable.Range(0, 17).Select(x => new KeyValuePair<int, T>(x, createValue())));
Text\CompositeTextTests.cs (1)
50return textLines.Select(l => l.Text!.ToString(l.SpanIncludingLineBreak));
Microsoft.CodeAnalysis.VisualBasic (4)
Declarations\MergedTypeDeclaration.vb (1)
159Select(s_mergeFunc)
Syntax\SyntaxReplacer.vb (3)
83Me._spanSet = New HashSet(Of TextSpan)(Me._nodeSet.Select(Function(n) n.FullSpan).Concat( 84Me._tokenSet.Select(Function(t) t.FullSpan)).Concat( 85Me._triviaSet.Select(Function(t) t.FullSpan)))
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Emit\EditAndContinue\AssemblyReferencesTests.vb (1)
352AssertEx.Equal(expected, reader.GetAssemblyReferences().Select(Function(aref) $"{reader.GetString(aref.Name)}, {aref.Version}"))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\GetImportScopesTests.vb (1)
505values.Select(Function(v) GlobalImport.Parse(v)))
FlowAnalysis\FlowTestBase.vb (1)
106Return If(Not symbols.IsEmpty(), String.Join(", ", symbols.Select(Function(symbol) symbol.Name)), Nothing)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
Syntax\SyntaxAnnotationTests.vb (2)
238Dim annotations = New List(Of SyntaxAnnotation)(Enumerable.Range(0, 3).Select(Function(x) 357Dim annotations = New List(Of SyntaxAnnotation)(Enumerable.Range(0, 10).Select(Function(s) New SyntaxAnnotation()))
Microsoft.CodeAnalysis.Workspaces (111)
CaseCorrection\CaseCorrector.cs (1)
49return await CaseCorrectAsync(document, root.GetAnnotatedNodesAndTokens(annotation).Select(n => n.Span).ToImmutableArray(), cancellationToken).ConfigureAwait(false);
CodeCleanup\AbstractCodeCleanerService.cs (3)
132var previousTokens = node.GetAnnotatedNodesAndTokens(previousMarkerAnnotation).Where(n => n.IsToken).Select(n => n.AsToken()); 133var nextTokens = node.GetAnnotatedNodesAndTokens(nextMarkerAnnotation).Where(n => n.IsToken).Select(n => n.AsToken()); 670var types = annotation.Data.Split(s_separators).Select(s => (SpanMarkerType)Enum.Parse(typeof(SpanMarkerType), s)).ToArray();
CodeCleanup\CodeCleaner.cs (1)
63return await CleanupAsync(document, root.GetAnnotatedNodesAndTokens(annotation).Select(n => n.Span).ToImmutableArray(), options, providers, cancellationToken: cancellationToken).ConfigureAwait(false);
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
172changedDocuments.AddRange(changedDocumentIds.Select(id => changedSolution.GetRequiredDocument(id)));
CodeFixesAndRefactorings\DefaultFixAllProviderHelpers.cs (1)
84.Select(solution.GetRequiredProject)
CodeRefactorings\FixAllOccurences\FixAllState.cs (1)
103return spansByDocument.Select(kvp => KeyValuePairUtil.Create(kvp.Key, new Optional<ImmutableArray<TextSpan>>(kvp.Value)))
Editing\ImportAdder.cs (1)
28return root.GetAnnotatedNodesAndTokens(annotation).Select(t => t.FullSpan);
Editing\SymbolEditor.cs (1)
196.Select(n => SyntaxGenerator.GetGenerator(OriginalSolution.Workspace, n.Language).GetDeclaration(n))
Editing\SyntaxGenerator.cs (13)
170name, parameters, typeParameters?.Select(TypeParameter), returnType, accessibility, modifiers, statements); 609isRecord: false, name, typeParameters?.Select(TypeParameter), accessibility, modifiers, baseType, interfaceTypes, members); 634isRecord: false, name, typeParameters?.Select(TypeParameter), accessibility, modifiers, interfaceTypes, members); 657name, typeParameters?.Select(n => TypeParameter(n)), accessibility, interfaceTypes, members); 703name, parameters, typeParameters?.Select(n => TypeParameter(n)), returnType, accessibility, modifiers); 768members: type.GetMembers().Where(CanBeDeclared).Select(Declaration)), 776members: type.GetMembers().Where(CanBeDeclared).Select(Declaration)), 782members: type.GetMembers().Where(CanBeDeclared).Select(Declaration)), 789members: type.GetMembers().Where(s => s.Kind == SymbolKind.Field).Select(Declaration)), 893=> WithTypeParameters(declaration, typeParameters.Select(n => TypeParameter(n))); 1443return new SyntaxTokenList(newList.Select( 1848=> GenericName(identifier, typeArguments.Select(TypeExpression)); 2008return TupleTypeExpression(elementTypes.Select(type => TupleElementExpression(type, name: null)));
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
228foreach (var dependentProject in dependentProjects.Select(dp => dp.project.Id))
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
496.Concat(projects.Select(p => p.Id)).ToSet(); 510.Select(solution.GetRequiredProject)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
62regularDocumentStates.States.Select(kvp => (kvp.Key, kvp.Value)).Concat(
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (1)
60var projectsToSearch = documents.Select(d => d.Project).Where(p => p.SupportsCompilation).ToImmutableHashSet();
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
88var referencingProjects = new HashSet<ProjectId>(solution.Projects.Where(p => p.MetadataReferences.Contains(reference)).Select(p => p.Id));
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (1)
75var adjustedChanges = changePartition.Select(c => new TextChange(TextSpan.FromBounds(c.Span.Start - startLineStartPosition, c.Span.End - startLineStartPosition), c.NewText!));
Log\AbstractLogAggregator.cs (1)
42=> _map.Select(static kvp => KeyValuePairUtil.Create((TKey)kvp.Key, kvp.Value)).GetEnumerator();
Rename\ConflictEngine\ConflictResolver.cs (1)
154foreach (var language in projectIds.Select(p => solution.GetRequiredProject(p).Language).Distinct())
Rename\ConflictEngine\ConflictResolver.Session.cs (5)
108_replacementTextValid = IsIdentifierValid_Worker(baseSolution, _replacementText, documentsGroupedByTopologicallySortedProjectId.Select(g => g.Key)); 187documentIdsThatGetsAnnotatedAndRenamed = new HashSet<DocumentId>(conflictLocations.Select(l => l.DocumentId)); 365.Select(t => t.OriginalIdentifierSpan) 717foreach (var language in documentsFromAffectedProjects.Select(d => d.Project.Language).Distinct()) 813.Select(t => t.ComplexifiedSpan)
Rename\ConflictEngine\MutableConflictResolution.cs (1)
147this.RelatedLocations.Select(l => l.DocumentId)).Distinct().ToImmutableArray();
Rename\RenameUtilities.cs (2)
91var documentsOfRenameSymbolDeclaration = symbol.Locations.Where(l => l.IsInSource).Select(l => solution.GetRequiredDocument(l.SourceTree!)); 95.Select(d => d.ProjectId).Distinct();
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
372.Select(t => Tuple.Create(t.ToString(), t.Span.Start, t.Span)); 390.Select(t => Tuple.Create(t.ToString(), t.Span.Start, t.Token.Span));
Shared\Extensions\ILanguageMetadataExtensions.cs (3)
20return services.Where(s => s.Metadata.Language == languageName).Select(s => s.Value).FirstOrDefault(); 26return services.Where(s => s.Metadata.Language == languageName).Select(s => s.Value); 41return builder.Select(kvp => KeyValuePairUtil.Create(kvp.Key, kvp.Value.ToImmutableAndFree())).ToImmutableDictionary();
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (2)
130tasks = waiters.Select(x => x.ExpeditedWaitAsync()).Where(t => !t.IsCompleted).ToList(); 244return _singletonListeners.Where(kv => featureNames.Contains(kv.Key)).Select(kv => (IAsynchronousOperationWaiter)kv.Value);
Shared\Utilities\SemanticMap.cs (1)
35return _expressionToInfoMap.Values.Concat(_tokenToInfoMap.Values).Select(info => info.Symbol).Distinct();
Simplification\Simplifier.cs (2)
189return await ReduceAsync(document, root.GetAnnotatedNodesAndTokens(annotation).Select(t => t.FullSpan), optionSet, cancellationToken).ConfigureAwait(false); 196return await ReduceAsync(document, root.GetAnnotatedNodesAndTokens(annotation).Select(t => t.FullSpan), options, cancellationToken).ConfigureAwait(false);
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
392.Select(x => (x.Key, x.Value?.RealAssemblyPath ?? ""))
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (2)
362builder.AddRange(source.Select(selector)); 540return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (1)
81.AddRange(source.Select(element => new KeyValuePair<TKey, TValue>(keySelector(element), elementSelector(element))));
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (1)
114return Enumerable.Select(immutableList, selector);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (2)
48.Select(x => x.section) 86.Select(x => x.section)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
512.Select(p => (p.Type ?? compilation.GetSpecialType(SpecialType.System_Object)).WithNullableAnnotation(p.NullableAnnotation));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
772return type?.RemoveUnavailableTypeParameters(compilation, availableTypeParameters.Select(t => t.Name).ToSet());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolDisplayPartExtensions.cs (1)
13=> string.Join(string.Empty, parts.Select(p => p.ToString()));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
328=> node.GetAnnotatedNodesAndTokens(syntaxAnnotation).Select(n => n.AsNode()).OfType<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
237foreach (var symbol in SymbolsWriteBuilder.Keys.Select(d => d.symbol).ToArray())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
226foreach (var (symbol, write) in SymbolsWriteBuilder.Where(kvp => !kvp.Value).Select(kvp => kvp.Key).ToArray())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (1)
49=> _formattingSpans ?? new TextSpanMutableIntervalTree(_formattingResults.Select(r => r.FormattedSpan));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (2)
272var tokens = node.GetAnnotatedTrivia(SyntaxAnnotation.ElasticAnnotation).Select(tr => tr.Token).Distinct(); 273return AggregateSpans(tokens.Select(GetElasticSpan));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (3)
154foreach (var symbolSpecApplicableKind in symbolSpecApplicableKinds.Split(',').Select(x => x.Trim())) 247foreach (var symbolSpecApplicableAccessibility in symbolSpecApplicableAccessibilities.Split(',').Select(x => x.Trim())) 317foreach (var symbolSpecRequiredModifier in symbolSpecRequiredModifiers.Split(',').Select(x => x.Trim()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (7)
72return words.Select(CapitalizeFirstLetter); 74return words.Take(1).Select(DecapitalizeFirstLetter).Concat(words.Skip(1).Select(CapitalizeFirstLetter)); 76return words.Take(1).Select(CapitalizeFirstLetter).Concat(words.Skip(1).Select(DecapitalizeFirstLetter)); 78return words.Select(w => w.ToUpper()); 80return words.Select(w => w.ToLower());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (2)
336.Select(NamingStyle.FromXElement).ToImmutableArray(), 338.Select(SerializableNamingRule.FromXElement).ToImmutableArray());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (1)
156.Select(ch =>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
129.AddRange(alternativeEntries.Select(static p => KeyValuePairUtil.Create(p.name, p.value)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (2)
175=> node.GetAnnotatedNodesAndTokens(annotationKind).Where(nt => nt.IsNode).Select(nt => nt.AsNode()!); 178=> node.GetAnnotatedNodesAndTokens(annotationKind).Where(nt => nt.IsToken).Select(nt => nt.AsToken());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (3)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePairUtil.Create(p.Value, p.Key)))) 30: this(forwardMap: ImmutableDictionary.CreateRange(keyComparer, pairs.Select(static p => KeyValuePairUtil.Create(p.key, p.value))), 31backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePairUtil.Create(p.value, p.key))))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
25.Select(f => f.ConstantValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
83return new ValueTask<T[]>(Task.WhenAll(taskArray.Select(task => task.AsTask())));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
78document.WithSyntaxRoot(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
457members.OfType<INamedTypeSymbol>().Select(n => n.ToCodeGenerationSymbol()).ToImmutableArray(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
120.Select(n => (syntaxnode: n, namespaceSymbol: GetExplicitNamespaceSymbol(n, model))); 242var importsToAdd = importToSyntax.Where(kvp => safeImportsToAdd.Contains(kvp.Key)).Select(kvp => kvp.Value).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
508.Select(field => field.AssociatedSymbol ?? field)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
83return GenerateUniqueName(baseName, filteredCandidates.Select(s => s.Name).Concat(usedNames));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
42.Select(lz => (lazyService: lz, usesFactory: false)); 44.Select(lz => (lazyService: new Lazy<ILanguageService, LanguageServiceMetadata>(() => lz.Value.CreateLanguageService(this), lz.Metadata), usesFactory: true));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (2)
46.Select(lz => (lz, usesFactory: false)); 48.Select(lz => (new Lazy<IWorkspaceService, WorkspaceServiceMetadata>(() => lz.Value.CreateService(this), lz.Metadata), usesFactory: true));
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
841getReferences: static project => project.AnalyzerReferences.Select(r => r.FullPath!),
Workspace\Solution\Checksum.cs (1)
106= checksums => string.Join("|", checksums.Select(c => c.ToString()));
Workspace\Solution\Project.cs (4)
196public IEnumerable<Document> Documents => DocumentIds.Select(GetDocument)!; 201public IEnumerable<TextDocument> AdditionalDocuments => AdditionalDocumentIds.Select(GetAdditionalDocument)!; 206public IEnumerable<AnalyzerConfigDocument> AnalyzerConfigDocuments => AnalyzerConfigDocumentIds.Select(GetAnalyzerConfigDocument)!; 461var results = await Task.WhenAll(this.Documents.Select(predicateAsync)).ConfigureAwait(false);
Workspace\Solution\ProjectDependencyGraph.cs (1)
157.Select(r => r.ProjectId)
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
27.Select(r => r.ProjectId)
Workspace\Solution\Solution.cs (1)
125public IEnumerable<Project> Projects => ProjectIds.Select(id => GetProject(id)!);
Workspace\Solution\SolutionCompilationState.cs (1)
111.Select(kvp => kvp.Key)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
822var syntaxTrees = generatorInfo.Documents.States.Values.Select(state => state.GetSyntaxTree(cancellationToken));
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
283var groups = emitResult.Diagnostics.GroupBy(d => d.Id).Select(g => $"{g.Key}:{g.Count()}");
Workspace\Solution\TextDocumentStates.cs (1)
68: this(states.Select(s => s.Id).ToImmutableList(),
Workspace\Workspace_Editor.cs (1)
282return _bufferToAssociatedDocumentsMap.Where(kvp => kvp.Value.Contains(documentId)).Select(kvp => kvp.Key).FirstOrDefault();
Microsoft.CodeAnalysis.Workspaces.Desktop (1)
Workspace\Host\Mef\MefV1HostServices.cs (1)
65var catalog = new AggregateCatalog(assemblies.Select(a => new AssemblyCatalog(a)));
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
src\Workspaces\Core\MSBuild.BuildHost\Rpc\Contracts\MonoMSBuildDiscovery.cs (2)
33.Select(p => p.Trim('"')); 76.Select(p => Path.Combine(p, "mono"))
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (14)
MSBuild\ProjectFile\CommandLineArgumentReader.cs (1)
217AddIfNotNullOrWhiteSpace("imports", string.Join(",", imports.Select(ReadImportItem)), addQuoteIfValueContainsWhitespace: false);
MSBuild\ProjectFile\Extensions.cs (1)
34.Select(CreateProjectFileReference);
MSBuild\ProjectFile\ProjectFile.cs (5)
166.Select(MakeDocumentFileInfo) 170.Select(MakeNonSourceFileDocumentFileInfo) 174.Select(MakeNonSourceFileDocumentFileInfo) 182var fileGlobs = _loadedProject?.GetAllGlobs().Select(GetFileGlobs).ToImmutableArray() ?? []; 225.Select(item => item.ItemSpec)
Rpc\Contracts\MonoMSBuildDiscovery.cs (2)
33.Select(p => p.Trim('"')); 76.Select(p => Path.Combine(p, "mono"))
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (2)
362builder.AddRange(source.Select(selector)); 540return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\Compilers\Core\Portable\InternalUtilities\ImmutableSetWithInsertionOrder`1.cs (1)
61get { return _map.OrderBy(kv => kv.Value).Select(kv => kv.Key); }
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (1)
81.AddRange(source.Select(element => new KeyValuePair<TKey, TValue>(keySelector(element), elementSelector(element))));
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (1)
114return Enumerable.Select(immutableList, selector);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
MSBuildWorkspaceTestBase.cs (1)
29AssertEx.Equal(expectedFailures, workspace.Diagnostics.Where(d => d.Kind == WorkspaceDiagnosticKind.Failure).Select(d => d.Message));
VisualStudioMSBuildWorkspaceTests.cs (2)
80var fileNames = new HashSet<string>(references.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath))); 3218project.MetadataReferences.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)).OrderBy(StringComparer.Ordinal));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (12)
MEF\IMefHostExportProviderExtensions.cs (1)
19=> provider.GetExports<TExtension>().Select(l => l.Value);
SolutionUtilities.cs (1)
36return solutionDifferences.GetProjectChanges().Select(n => n.NewProject.GetChanges(n.OldProject));
Workspaces\TestHostProject`1.cs (4)
151ProjectReferences = projectReferences != null ? projectReferences.Select(p => new ProjectReference(p.Id)) : SpecializedCollections.EmptyEnumerable<ProjectReference>(); 265documents: Documents.Where(d => !d.IsSourceGenerated).Select(d => d.ToDocumentInfo()), 269additionalDocuments: AdditionalDocuments.Select(d => d.ToDocumentInfo()), 270analyzerConfigDocuments: AnalyzerConfigDocuments.Select(d => d.ToDocumentInfo()),
Workspaces\TestWorkspace_XmlConsumption.cs (2)
422.Select(x => GlobalImport.Parse(x.Value)).ToList(); 729var aliases = aliasElement != null ? aliasElement.Split(',').Select(s => s.Trim()).ToImmutableArray() : default;
Workspaces\TestWorkspace_XmlCreation.cs (2)
127var value = string.Join(";", parseOptions.Features.Select(p => $"{p.Key}={p.Value}")); 155element.Add(vbOptions.GlobalImports.AsEnumerable().Select(i => new XElement(GlobalImportElementName, i.Name)));
Workspaces\TestWorkspace`1.cs (2)
249=> this.OnSolutionAdded(SolutionInfo.Create(solution.Id, solution.Version, solution.FilePath, projects: solution.Projects.Select(p => p.ToProjectInfo()))); 691var aliases = projectReference.Attributes(AliasAttributeName).Select(a => a.Value).ToImmutableArray();
Microsoft.CodeAnalysis.Workspaces.UnitTests (18)
CodeStyle\NamingStylePreferencesUpgradeTests.cs (1)
200.Select(e => e.name)
FindReferencesTests.cs (4)
39projectReferences: projectReferences.Select(p => new ProjectReference(p))); 55projectReferences: projectReferences.Select(p => new ProjectReference(p))); 496var refsFromVirtualSorted = refsFromVirtual.Select(r => r.Definition).OrderBy(r => r.ContainingType.Name).ToArray(); 497var refsFromOverrideSorted = refsFromOverride.Select(r => r.Definition).OrderBy(r => r.ContainingType.Name).ToArray();
Remote\ServiceDescriptorTests.cs (1)
131foreach (var type in method.GetParameters().Select(p => p.ParameterType))
SolutionTests\SolutionTests.cs (1)
2924var projectIds = Enumerable.Range(0, 5).Select(i => ProjectId.CreateNewId()).ToArray();
SymbolKeyTests.cs (8)
335symbols.Select(s => s.ToDisplayString())); 359TestRoundTrip(GetDeclaredSymbols(compilation).OfType<IFieldSymbol>().Select(fs => fs.Type), compilation); 377TestRoundTrip(GetDeclaredSymbols(compilation).OfType<IFieldSymbol>().Select(fs => fs.Type), compilation, s => s.ToDisplayString()); 620var symbols = tree.GetRoot().DescendantNodes().OfType<CSharp.Syntax.InvocationExpressionSyntax>().Select(s => model.GetSymbolInfo(s).Symbol).ToList(); 679var symbols = tree.GetRoot().DescendantNodes().OfType<CSharp.Syntax.UsingDirectiveSyntax>().Select(s => model.GetDeclaredSymbol(s)).ToList(); 685var refSymbols = GetDeclaredSymbols(compilation).OfType<IFieldSymbol>().Select(f => f.Type).ToList(); 704var symbols = GetDeclaredSymbols(compilation).OfType<IFieldSymbol>().Select(f => f.Type).ToList(); 1257var fields = GetDeclaredSymbols(comp).OfType<IFieldSymbol>().Select(f => f.Type);
UtilityTest\IntervalTreeTests.cs (3)
327}).Select(t => t.Item3)); 334}).Select(t => t.Item3)); 340Assert.True(new HashSet<string>(spans.Select(t => t.Item3)).SetEquals(tree.Select(i => i.Item3)));
Microsoft.CommonLanguageServerProtocol.Framework.Package (3)
AbstractLanguageServer.cs (2)
115var requestTypes = methodGroup.Select(m => m.RequestTypeRef); 116var responseTypes = methodGroup.Select(m => m.ResponseTypeRef);
RequestExecutionQueue.cs (1)
361await Task.WhenAll(concurrentlyExecutingTasksArray.Select(kvp => kvp.Key)).NoThrowAwaitable(captureContext: false);
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (1)
Mocks\TestHandlerProvider.cs (1)
23=> _providers.Select(p => p.metadata).ToImmutableArray();
Microsoft.Data.Analysis (7)
DataFrame.IO.cs (1)
63IEnumerable<string> lines = read.Select(line => col < line.Line.Length ? line.Line[col] : throw new FormatException(string.Format(Strings.LessColumnsThatExpected, line.LineNumber + 1)));
DataFrame.Join.cs (2)
285var retainJoinColumns = retainedJoinColumnNames.Select(name => retainedDataFrame.Columns[name]).ToArray(); 390var columns = supplementaryJoinColumns.Select(name => supplementaryDataFrame.Columns[name]).ToArray();
DataFrameRow.cs (1)
42return _dataFrame.Columns.Select(col => new KeyValuePair<string, object>(col.Name, col[_rowIndex]));
GroupBy.cs (2)
503return _keyToRowIndicesMap.Select(kvp => new Grouping(kvp.Key, kvp.Value.Select(index => _dataFrame.Rows[index])));
PrimitiveDataFrameColumn.cs (1)
530return Clone(mapIndices.Select(x => (long)x));
Microsoft.Data.Analysis.Interactive (8)
DataFrameKernelExtension.cs (3)
48header.AddRange(df.Columns.Select(c => (IHtmlContent)th(c.Name))); 100tbody(rows.Select(r => tr[style: "display: none"](r))), 127tbody(rows.Select(r => tr(r)))
TabularDataResourceExtensions.cs (5)
27var column = tabularDataResource.Data.Select(row => 42dataFrame.Columns.Add(new DoubleDataFrameColumn(fieldDescriptor.Name, column.Select(Convert.ToDouble))); 45dataFrame.Columns.Add(new Int64DataFrameColumn(fieldDescriptor.Name, column.Select(Convert.ToInt64))); 48dataFrame.Columns.Add(new BooleanDataFrameColumn(fieldDescriptor.Name, column.Select(Convert.ToBoolean))); 51dataFrame.Columns.Add(new StringDataFrameColumn(fieldDescriptor.Name, column.Select(Convert.ToString)));
Microsoft.Data.Analysis.Interactive.Tests (3)
DataFrameInteractiveTests.cs (3)
22DataFrameColumn dataFrameColumn1 = new Int32DataFrameColumn("Int1", Enumerable.Range(0, length).Select(x => x)); 23DataFrameColumn dataFrameColumn2 = new Int32DataFrameColumn("Int2", Enumerable.Range(10, length).Select(x => x)); 92Assert.Equal(dataFrame.Columns.Select(c => c.Name).ToArray(), new[] { "TrueOrFalse", "Integer", "Double", "Text" });
Microsoft.Data.Analysis.PerformanceTests (5)
PerformanceTests.cs (5)
38var shortValues = values.Select(v => (short)(v % short.MaxValue + 1)).ToArray(); 42_doubleColumn1 = new DoubleDataFrameColumn("Column1", values.Select(v => (double)v)); 43_doubleColumn2 = new DoubleDataFrameColumn("Column2", values.Select(v => (double)v)); 45_floatColumn1 = new SingleDataFrameColumn("Column1", values.Select(v => (float)v)); 46_floatColumn2 = new SingleDataFrameColumn("Column2", values.Select(v => (float)v));
Microsoft.Data.Analysis.Tests (573)
ArrowIntegrationTests.cs (2)
48.Append("StringDataFrameColumn", false, new StringArray.Builder().AppendRange(Enumerable.Range(0, 10).Select(x => x.ToString())).Build()) 99.Append(prependColumnNamesWith + "StringDataFrameColumn", false, new StringArray.Builder().AppendRange(Enumerable.Range(0, 10).Select(x => x.ToString())).Build())
DataFrame.IOTests.cs (6)
695var columnName = df.Columns.Select(c => c.Name); 710var columnName = df.Columns.Select(c => c.Name); 1191var resColumns = table.Columns.Cast<DataColumn>().Select(column => (column.ColumnName, column.DataType)).ToArray(); 1194var resVals = table.Rows.Cast<DataRow>().Select(row => row.ItemArray).ToArray(); 1228var resColumns = dataFrame.Columns.Select(column => (column.Name, column.DataType)).ToArray(); 1230var resVals = dataFrame.Rows.Select(row => row.ToArray()).ToArray();
DataFrameColumn.BinaryOperationTests.cs (495)
26var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 28var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 31var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); 39var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 41var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); 44var verify = Enumerable.Range(1, 10).Select(x => (decimal)(2 * x)); 52var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 54var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); 57var verify = Enumerable.Range(1, 10).Select(x => (double)(2 * x)); 65var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 67var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); 70var verify = Enumerable.Range(1, 10).Select(x => (float)(2 * x)); 78var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 80var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); 83var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); 91var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 93var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); 96var verify = Enumerable.Range(1, 10).Select(x => (long)(2 * x)); 104var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 106var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); 109var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); 117var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 119var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); 122var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); 130var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 132var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); 135var verify = Enumerable.Range(1, 10).Select(x => (uint)(2 * x)); 143var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 145var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); 148var verify = Enumerable.Range(1, 10).Select(x => (ulong)(2 * x)); 156var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 158var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); 161var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); 169var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 173var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 181var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 185var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x + (decimal)value)); 193var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 197var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x + (double)value)); 205var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 209var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x + (float)value)); 217var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 221var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 229var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 233var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x + (long)value)); 241var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 245var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 253var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 257var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 265var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 269var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x + (uint)value)); 277var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 281var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x + (ulong)value)); 289var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 293var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 301var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 305var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 313var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 317var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x + (decimal)value)); 325var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 329var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x + (double)value)); 337var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 341var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x + (float)value)); 349var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 353var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 361var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 365var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x + (long)value)); 373var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 377var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 385var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 389var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 397var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 401var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x + (uint)value)); 409var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 413var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x + (ulong)value)); 421var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 425var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); 433var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 435var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 438var verify = Enumerable.Range(1, 10).Select(x => (int)0); 446var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 448var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); 451var verify = Enumerable.Range(1, 10).Select(x => (decimal)0); 459var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 461var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); 464var verify = Enumerable.Range(1, 10).Select(x => (double)0); 472var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 474var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); 477var verify = Enumerable.Range(1, 10).Select(x => (float)0); 485var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 487var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); 490var verify = Enumerable.Range(1, 10).Select(x => (int)0); 498var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 500var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); 503var verify = Enumerable.Range(1, 10).Select(x => (long)0); 511var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 513var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); 516var verify = Enumerable.Range(1, 10).Select(x => (int)0); 524var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 526var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); 529var verify = Enumerable.Range(1, 10).Select(x => (int)0); 537var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 539var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); 542var verify = Enumerable.Range(1, 10).Select(x => (uint)0); 550var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 552var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); 555var verify = Enumerable.Range(1, 10).Select(x => (ulong)0); 563var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 565var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); 568var verify = Enumerable.Range(1, 10).Select(x => (int)0); 576var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 580var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); 588var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 592var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x - (decimal)value)); 600var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 604var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x - (double)value)); 612var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 616var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x - (float)value)); 624var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 628var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); 636var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 640var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x - (long)value)); 648var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 652var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); 660var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 664var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); 672var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 676var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x - (uint)value)); 684var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 688var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x - (ulong)value)); 696var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 700var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); 708var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 712var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); 720var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 724var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)value - (decimal)x)); 732var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 736var verify = Enumerable.Range(1, 10).Select(x => (double)((double)value - (double)x)); 744var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 748var verify = Enumerable.Range(1, 10).Select(x => (float)((float)value - (float)x)); 756var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 760var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); 768var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 772var verify = Enumerable.Range(1, 10).Select(x => (long)((long)value - (long)x)); 780var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 784var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); 792var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 796var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); 804var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 808var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)value - (uint)x)); 816var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 820var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)value - (ulong)x)); 828var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 832var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); 840var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 842var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 845var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); 853var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 855var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); 858var verify = Enumerable.Range(1, 10).Select(x => (decimal)(x * x)); 866var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 868var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); 871var verify = Enumerable.Range(1, 10).Select(x => (double)(x * x)); 879var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 881var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); 884var verify = Enumerable.Range(1, 10).Select(x => (float)(x * x)); 892var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 894var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); 897var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); 905var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 907var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); 910var verify = Enumerable.Range(1, 10).Select(x => (long)(x * x)); 918var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 920var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); 923var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); 931var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 933var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); 936var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); 944var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 946var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); 949var verify = Enumerable.Range(1, 10).Select(x => (uint)(x * x)); 957var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 959var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); 962var verify = Enumerable.Range(1, 10).Select(x => (ulong)(x * x)); 970var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 972var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); 975var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); 983var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 987var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 995var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 999var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x * (decimal)value)); 1007var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1011var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x * (double)value)); 1019var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1023var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x * (float)value)); 1031var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1035var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 1043var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1047var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x * (long)value)); 1055var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1059var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 1067var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1071var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 1079var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1083var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x * (uint)value)); 1091var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1095var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x * (ulong)value)); 1103var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1107var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 1115var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1119var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 1127var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1131var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x * (decimal)value)); 1139var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1143var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x * (double)value)); 1151var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1155var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x * (float)value)); 1163var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1167var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 1175var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1179var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x * (long)value)); 1187var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1191var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 1199var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1203var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 1211var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1215var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x * (uint)value)); 1223var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1227var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x * (ulong)value)); 1235var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1239var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); 1247var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1249var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1252var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); 1260var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1262var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); 1265var verify = Enumerable.Range(1, 10).Select(x => (decimal)(1)); 1273var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1275var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); 1278var verify = Enumerable.Range(1, 10).Select(x => (double)(1)); 1286var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1288var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); 1291var verify = Enumerable.Range(1, 10).Select(x => (float)(1)); 1299var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1301var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); 1304var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); 1312var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1314var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); 1317var verify = Enumerable.Range(1, 10).Select(x => (long)(1)); 1325var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1327var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); 1330var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); 1338var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1340var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); 1343var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); 1351var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1353var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); 1356var verify = Enumerable.Range(1, 10).Select(x => (uint)(1)); 1364var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1366var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); 1369var verify = Enumerable.Range(1, 10).Select(x => (ulong)(1)); 1377var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1379var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); 1382var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); 1390var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1394var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); 1402var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1406var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x / (decimal)value)); 1414var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1418var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x / (double)value)); 1426var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1430var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x / (float)value)); 1438var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1442var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); 1450var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1454var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x / (long)value)); 1462var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1466var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); 1474var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1478var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); 1486var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1490var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x / (uint)value)); 1498var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1502var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x / (ulong)value)); 1510var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1514var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); 1522var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1526var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); 1534var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1538var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)value / (decimal)x)); 1546var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1550var verify = Enumerable.Range(1, 10).Select(x => (double)((double)value / (double)x)); 1558var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1562var verify = Enumerable.Range(1, 10).Select(x => (float)((float)value / (float)x)); 1570var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1574var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); 1582var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1586var verify = Enumerable.Range(1, 10).Select(x => (long)((long)value / (long)x)); 1594var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1598var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); 1606var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1610var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); 1618var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1622var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)value / (uint)x)); 1630var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1634var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)value / (ulong)x)); 1642var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1646var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); 1654var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1656var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1659var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); 1667var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1669var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); 1672var verify = Enumerable.Range(1, 10).Select(x => (decimal)(0)); 1680var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1682var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); 1685var verify = Enumerable.Range(1, 10).Select(x => (double)(0)); 1693var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1695var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); 1698var verify = Enumerable.Range(1, 10).Select(x => (float)(0)); 1706var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1708var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); 1711var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); 1719var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1721var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); 1724var verify = Enumerable.Range(1, 10).Select(x => (long)(0)); 1732var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1734var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); 1737var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); 1745var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1747var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); 1750var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); 1758var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1760var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); 1763var verify = Enumerable.Range(1, 10).Select(x => (uint)(0)); 1771var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1773var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); 1776var verify = Enumerable.Range(1, 10).Select(x => (ulong)(0)); 1784var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1786var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); 1789var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); 1797var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1801var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); 1809var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1813var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x % (decimal)value)); 1821var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1825var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x % (double)value)); 1833var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1837var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x % (float)value)); 1845var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1849var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); 1857var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1861var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x % (long)value)); 1869var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1873var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); 1881var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1885var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); 1893var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1897var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x % (uint)value)); 1905var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1909var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x % (ulong)value)); 1917var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1921var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); 1929var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1933var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); 1941var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1945var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)value % (decimal)x)); 1953var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1957var verify = Enumerable.Range(1, 10).Select(x => (double)((double)value % (double)x)); 1965var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1969var verify = Enumerable.Range(1, 10).Select(x => (float)((float)value % (float)x)); 1977var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1981var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); 1989var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 1993var verify = Enumerable.Range(1, 10).Select(x => (long)((long)value % (long)x)); 2001var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2005var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); 2013var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2017var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); 2025var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2029var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)value % (uint)x)); 2037var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2041var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)value % (ulong)x)); 2049var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2053var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); 2061var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2063var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2066var verify = Enumerable.Range(1, 10).Select(x => true); 2076var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2078var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); 2081var verify = Enumerable.Range(1, 10).Select(x => true); 2091var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2093var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); 2096var verify = Enumerable.Range(1, 10).Select(x => true); 2106var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2108var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); 2111var verify = Enumerable.Range(1, 10).Select(x => true); 2121var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2123var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); 2126var verify = Enumerable.Range(1, 10).Select(x => true); 2136var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2138var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); 2141var verify = Enumerable.Range(1, 10).Select(x => true); 2151var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2153var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); 2156var verify = Enumerable.Range(1, 10).Select(x => true); 2166var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2168var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); 2171var verify = Enumerable.Range(1, 10).Select(x => true); 2181var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2183var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); 2186var verify = Enumerable.Range(1, 10).Select(x => true); 2196var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2198var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); 2201var verify = Enumerable.Range(1, 10).Select(x => true); 2211var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2213var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); 2216var verify = Enumerable.Range(1, 10).Select(x => true); 2226var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2230var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2238var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2242var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2250var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2254var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2262var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2266var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2274var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2278var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2286var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2290var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2298var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2302var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2310var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2314var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2322var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2326var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2334var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2338var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2346var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2350var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2358var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2360var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2363var verify = Enumerable.Range(1, 10).Select(x => true); 2373var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2375var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); 2378var verify = Enumerable.Range(1, 10).Select(x => true); 2388var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2390var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); 2393var verify = Enumerable.Range(1, 10).Select(x => true); 2403var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2405var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); 2408var verify = Enumerable.Range(1, 10).Select(x => true); 2418var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2420var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); 2423var verify = Enumerable.Range(1, 10).Select(x => true); 2433var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2435var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); 2438var verify = Enumerable.Range(1, 10).Select(x => true); 2448var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2450var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); 2453var verify = Enumerable.Range(1, 10).Select(x => true); 2463var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2465var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); 2468var verify = Enumerable.Range(1, 10).Select(x => true); 2478var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2480var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); 2483var verify = Enumerable.Range(1, 10).Select(x => true); 2493var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2495var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); 2498var verify = Enumerable.Range(1, 10).Select(x => true); 2508var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2510var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); 2513var verify = Enumerable.Range(1, 10).Select(x => true); 2523var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2527var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2535var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2539var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2547var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2551var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2559var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2563var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2571var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2575var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2583var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2587var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2595var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2599var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2607var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2611var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2619var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2623var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2631var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2635var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); 2643var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); 2647var verify = Enumerable.Range(1, 10).Select(x => (bool)(false));
DataFrameGroupByTests.cs (3)
84var values = rows.Select(row => Convert.ToInt32(row[colIndex])); 113DataFrameColumn parityColumn = new StringDataFrameColumn("Parity", Enumerable.Range(0, length).Select(x => x % 2 == 0 ? "even" : "odd")); 114DataFrameColumn tensColumn = new Int32DataFrameColumn("Tens", Enumerable.Range(0, length).Select(x => x / 10));
DataFrameIDataViewTests.cs (1)
116DataFrameColumn boolColumn = new PrimitiveDataFrameColumn<bool>("Bool", Enumerable.Range(0, (int)df.Rows.Count).Select(x => x % 2 == 1));
DataFrameTests.BinaryOperations.cs (7)
164var dataFrameColumn1 = new DoubleDataFrameColumn("Double1", Enumerable.Range(0, 10).Select(x => (double)x)); 174var dataFrameColumn1 = new BooleanDataFrameColumn("Bool1", Enumerable.Range(0, 10).Select(x => true)); 175var dataFrameColumn2 = new BooleanDataFrameColumn("Bool2", Enumerable.Range(0, 10).Select(x => true)); 206var dataFrameColumn1 = new DateTimeDataFrameColumn("DateTime1", Enumerable.Range(0, 5).Select(x => SampleDateTime.AddDays(x))); 208var dataFrameColumn2 = new DateTimeDataFrameColumn("DateTime2", Enumerable.Range(0, 4).Select(x => SampleDateTime.AddDays(x))); 304DataFrameColumn stringColumn = new StringDataFrameColumn("String", Enumerable.Range(0, 10).Select(x => x.ToString())); 315DataFrameColumn stringColumnCopy = new StringDataFrameColumn("String", Enumerable.Range(0, 10).Select(x => x.ToString()));
DataFrameTests.Computations.cs (8)
439Assert.Equal((byte)byteColumn.Max(), range.Select(x => (byte)x).Max()); 450Assert.Equal((uint)uintColumn.Max(), range.Select(x => (uint)x).Max()); 453Assert.Equal((ulong)ulongColumn.Max(), range.Select(x => (ulong)x).Max()); 456Assert.Equal((ushort)ushortColumn.Max(), range.Select(x => (ushort)x).Max()); 459Assert.Equal((byte)byteColumn.Min(), range.Select(x => (byte)x).Min()); 470Assert.Equal((uint)uintColumn.Min(), range.Select(x => (uint)x).Min()); 473Assert.Equal((ulong)ulongColumn.Min(), range.Select(x => (ulong)x).Min()); 476Assert.Equal((ushort)ushortColumn.Min(), range.Select(x => (ushort)x).Min());
DataFrameTests.cs (24)
63DataFrameColumn intColumn = new Int32DataFrameColumn("IntColumn", Enumerable.Range(0, rowCount).Select(x => x)); 64DataFrameColumn floatColumn = new SingleDataFrameColumn("FloatColumn", Enumerable.Range(0, rowCount).Select(x => (float)x)); 77DataFrameColumn bigColumn = new SingleDataFrameColumn("BigColumn", Enumerable.Range(0, rowCount + 1).Select(x => (float)x)); 82DataFrameColumn smallColumn = new SingleDataFrameColumn("SmallColumn", Enumerable.Range(0, rowCount - 1).Select(x => (float)x)); 87DataFrameColumn repeatedName = new SingleDataFrameColumn("FloatColumn", Enumerable.Range(0, rowCount).Select(x => (float)x)); 91DataFrameColumn extraColumn = new SingleDataFrameColumn("OtherFloatColumn", Enumerable.Range(0, rowCount).Select(x => (float)x)); 96DataFrameColumn intColumnCopy = new Int32DataFrameColumn("IntColumn", Enumerable.Range(0, rowCount).Select(x => x)); 99DataFrameColumn differentIntColumn = new Int32DataFrameColumn("IntColumn1", Enumerable.Range(0, rowCount).Select(x => x)); 118DataFrameColumn intColumn = new Int32DataFrameColumn("NewIntColumn", Enumerable.Range(0, 10).Select(x => x)); 152DataFrameColumn intColumn = new Int32DataFrameColumn("NewIntColumn", Enumerable.Range(0, 10).Select(x => x)); 806Assert.Throws<ArgumentException>(() => df.Columns.Insert(1, new Int32DataFrameColumn("Int2", Enumerable.Range(0, 5).Select(x => x)))); 1204StringDataFrameColumn column = new StringDataFrameColumn("Strings", Enumerable.Range(0, 11).Select(x => x.ToString())); 1250DataFrameColumn stringColumn = DataFrameColumn.Create("String", Enumerable.Range(0, length).Select(x => x.ToString())); 1252DataFrameColumn byteColumn = DataFrameColumn.Create("Byte", Enumerable.Range(0, length).Select(x => (byte)x)); 1254DataFrameColumn decimalColumn = DataFrameColumn.Create("Decimal", Enumerable.Range(0, length).Select(x => (decimal)x)); 1256DataFrameColumn doubleColumn = DataFrameColumn.Create("Double", Enumerable.Range(0, length).Select(x => (double)x)); 1258DataFrameColumn floatColumn = DataFrameColumn.Create("Float", Enumerable.Range(0, length).Select(x => (float)x)); 1260DataFrameColumn intColumn = DataFrameColumn.Create("Int", Enumerable.Range(0, length).Select(x => x)); 1262DataFrameColumn longColumn = DataFrameColumn.Create("Long", Enumerable.Range(0, length).Select(x => (long)x)); 1264DataFrameColumn sbyteColumn = DataFrameColumn.Create("Sbyte", Enumerable.Range(0, length).Select(x => (sbyte)x)); 1266DataFrameColumn shortColumn = DataFrameColumn.Create("Short", Enumerable.Range(0, length).Select(x => (short)x)); 1268DataFrameColumn uintColumn = DataFrameColumn.Create("Uint", Enumerable.Range(0, length).Select(x => (uint)x)); 1270DataFrameColumn ulongColumn = DataFrameColumn.Create("Ulong", Enumerable.Range(0, length).Select(x => (ulong)x)); 1272DataFrameColumn ushortColumn = DataFrameColumn.Create("Ushort", Enumerable.Range(0, length).Select(x => (ushort)x));
DataFrameTests.Filter.cs (2)
46DataFrame boolEnumerableFiltered = df[Enumerable.Range(0, 10).Select(x => true)]; 47DataFrame longEnumerableFiltered = df[Enumerable.Range(0, 10).Select(x => (long)x)];
DataFrameTests.Merge.cs (2)
22DataFrameColumn leftStringColumn = new StringDataFrameColumn("String", Enumerable.Range(0, leftCount).Select(x => "Left")); 26DataFrameColumn rightStringColumn = new StringDataFrameColumn("String", Enumerable.Range(0, rightCount).Select(x => "Right"));
DataFrameTests.Utils.cs (20)
19DataFrameColumn dataFrameColumn1 = new Int32DataFrameColumn("Int1", Enumerable.Range(0, length).Select(x => x)); 20DataFrameColumn dataFrameColumn2 = new Int32DataFrameColumn("Int2", Enumerable.Range(10, length).Select(x => x)); 105DataFrameColumn boolColumn = new BooleanDataFrameColumn("Bool", Enumerable.Range(0, length).Select(x => x % 2 == 0)); 117DataFrameColumn boolColumn = new BooleanDataFrameColumn("Bool", Enumerable.Range(0, length).Select(x => x % 2 == 0)); 129DataFrameColumn stringColumn = new StringDataFrameColumn("String", Enumerable.Range(0, length).Select(x => x.ToString())); 136DataFrameColumn charColumn = new CharDataFrameColumn("Char", Enumerable.Range(0, length).Select(x => (char)(x + 65))); 150DataFrameColumn dateTimeColumn = new DateTimeDataFrameColumn("DateTime", Enumerable.Range(0, length).Select(x => SampleDateTime.AddDays(x))); 163var byteColumn = new ByteDataFrameColumn("Byte", range.Select(x => (byte)x)); 164var decimalColumn = new DecimalDataFrameColumn("Decimal", range.Select(x => (decimal)x)); 165var doubleColumn = new DoubleDataFrameColumn("Double", range.Select(x => (double)x)); 166var floatColumn = new SingleDataFrameColumn("Float", range.Select(x => (float)x)); 167var intColumn = new Int32DataFrameColumn("Int", range.Select(x => x)); 168var longColumn = new Int64DataFrameColumn("Long", range.Select(x => (long)x)); 169var sbyteColumn = new SByteDataFrameColumn("Sbyte", range.Select(x => (sbyte)x)); 170var shortColumn = new Int16DataFrameColumn("Short", range.Select(x => (short)x)); 171var uintColumn = new UInt32DataFrameColumn("Uint", range.Select(x => (uint)x)); 172var ulongColumn = new UInt64DataFrameColumn("Ulong", range.Select(x => (ulong)x)); 173var ushortColumn = new UInt16DataFrameColumn("Ushort", range.Select(x => (ushort)x)); 207DataFrameColumn baseColumn1 = DataFrameColumn.Create("Column1", Enumerable.Range(0, length).Select(x => (T1)Convert.ChangeType(x % 2 == 0 ? 0 : 1, typeof(T1)))); 208DataFrameColumn baseColumn2 = DataFrameColumn.Create("Column2", Enumerable.Range(0, length).Select(x => (T2)Convert.ChangeType(x % 2 == 0 ? 0 : 1, typeof(T2))));
PrimitiveDataFrameColumnTests.cs (3)
63StringDataFrameColumn strCol2 = new StringDataFrameColumn("String", Enumerable.Range(0, 10).Select(x => x.ToString())); 66StringDataFrameColumn strCol3 = new StringDataFrameColumn("String", Enumerable.Range(0, 10).Select(x => (string)null)); 97PrimitiveDataFrameColumn<int> dataFrameColumn1 = new PrimitiveDataFrameColumn<int>("Int1", Enumerable.Range(0, 10).Select(x => x));
Microsoft.DotNet.Arcade.Sdk (10)
src\DownloadFile.cs (1)
101Log.LogError($"Download from all targets failed. List of attempted targets: {string.Join(", ", Uris.Select(m => m.ItemSpec))}");
src\GenerateResxSource.cs (5)
507.Select(m => m.Groups[1].Value) 525public string GetArgumentNames() => string.Join(", ", _arguments.Select(a => "\"" + a + "\"")); 527public string GetArguments() => string.Join(", ", _arguments.Select(GetArgName)); 534return string.Join(", ", _arguments.Select(a => "object " + GetArgName(a))); 536return string.Join(", ", _arguments.Select(a => GetArgName(a)));
src\InstallDotNetCore.cs (1)
82if (runtimeItems.SelectMany(r => r.Value).Select(r => r.Key).FirstOrDefault(f => !SemanticVersion.TryParse(f, out SemanticVersion version)) != null)
src\SaveItems.cs (1)
39metadataPairs = metadata.Keys.OfType<string>().Select(key => new KeyValuePair<string, string>(key, metadata[key] as string));
src\SourceBuild\AddSourceMappingToNugetConfig.cs (1)
51.Select(e => e.Attribute("pattern").Value)
src\SourceBuild\ReadSourceBuildIntermediateNupkgDependencies.cs (1)
55.Select(d =>
Microsoft.DotNet.Arcade.Sdk.Tests (6)
GetAssemblyFullNameTests.cs (2)
37}, task.ItemsWithFullName.Select(i => i.GetMetadata("SomeFullName"))); 64}, task.ItemsWithFullName.Select(i => i.GetMetadata("SomeFullName")));
GroupItemsByTests.cs (2)
38}, task.GroupedItems.Select(i => $"{i.ItemSpec}: {string.Join(" ", inspectMetadata.Select(m => $"{m}='{i.GetMetadata(m)}'"))}"));
SourceMappingToNugetConfigTest.cs (2)
65.Select(a => a.Value) 72.Select(a => a.Value)
Microsoft.DotNet.AsmDiff (9)
AssemblySet.cs (6)
42.Select(a => a.Reference.ResolvedAssembly) 78var firstLocation = assemblies.Select(a => a.Location).First(); 131var assemblyPaths = Assemblies.Except(snapshot).Select(a => a.Location).ToArray(); 132var dependencyPaths = Dependencies.Except(snapshot).Select(a => a.Location).ToArray(); 135var newAssemblies = assemblyPaths.Select(p => newAssemblySet.Host.LoadUnitFrom(p)).OfType<IAssembly>(); 192.Select(r => r.ResolvedAssembly.IsDummy() ? r : r.ResolvedAssembly);
Csv\DiffTokensCsvColumn.cs (1)
59return string.Concat(tokens.Select(t => t.Token));
DiffCSharpWriter.cs (1)
381.Select(Assembly.LoadFrom);
DiffEngine.cs (1)
57csvTextWriter.WriteLine(diffColumns.Select(c => c.Name));
Microsoft.DotNet.Build.Tasks.Feed (8)
src\BlobFeedAction.cs (1)
66await System.Threading.Tasks.Task.WhenAll(taskItems.Select(
src\common\LatestLinksManager.cs (1)
79.Select(asset =>
src\model\TargetChannelConfig.cs (1)
76$"\n {string.Join("\n ", TargetFeeds.Select(f => $"{string.Join(", ", f.ContentTypes)} -> {f.FeedUrl}"))}" +
src\PublishSignedAssets.cs (1)
85Directory.GetFiles(packagesFolder).Select(packagePath =>
src\PushToBuildStorage.cs (4)
149.Select(i => blobArtifactModelFactory.CreateBlobArtifactModel(i, ManifestRepoOrigin)); 165.Select(i => 214packageArtifacts = packageItems.Select( 216blobArtifacts = blobItems.Select(
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
BuildModelFactoryTests.cs (1)
424modelFromItems.Identity.Attributes.Select(kv => $"{kv.Key}={kv.Value}").ToArray(),
Microsoft.DotNet.Build.Tasks.Installers (9)
src\BuildFPMToolPreReqs.cs (1)
159.Select(pair => new RpmDependency
src\CreateRpmPackage.cs (2)
112HashSet<string> ownedDirectories = new(OwnedDirectories.Select(d => d.ItemSpec)); 121Dictionary<string, string> filePathToKind = RawPayloadFileKinds.Select(k => k.ItemSpec.Split(':')).ToDictionary(k => k[0], k => k[1].Trim());
src\GenerateMacOSDistributionFile.cs (5)
65.Select(component => new XElement("choice", 77choiceElements.Select(c => new XElement(c) 80choiceElements.Select(c => new XElement(c) 87.Select(c => new XElement("line", new XAttribute("choice", c.Attribute("id").Value))); 90.Select(component => new XElement("pkg-ref",
src\StabilizeWixFileId.cs (1)
80string.Join(", ", matchingFileElements.Select(e => e.ToString())));
Microsoft.DotNet.Build.Tasks.Packaging (109)
ApplyBaseLine.cs (1)
105var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath")));
ApplyMetaPackages.cs (2)
56var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath"))); 119updatedDependencies.AddRange(metaPackagesToAdd.SelectMany(pair => pair.Value.Select(tfm => CreateDependency(pair.Key, tfm))));
ApplyPreReleaseSuffix.cs (1)
66_index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath")));
CreateTrimDependencyGroups.cs (5)
68var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath"))); 72.Select(dependencyItem => new TaskItemPackageDependency(dependencyItem)) 74.Select(dependencyGrouping => new TaskItemPackageDependencyGroup(dependencyGrouping.Key, dependencyGrouping)) 78PackageItem[] packageItems = Files.Select(f => new PackageItem(f)).ToArray(); 79var packagePaths = packageItems.Select(pi => pi.TargetPath);
Extensions.cs (1)
127.Select(s => TrimAndGetNullForEmpty(s))
FilterUnknownPackages.cs (2)
41var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath"))); 46var baseLinePackageIds = new HashSet<string>(BaseLinePackages.NullAsEmpty().Select(b => b.ItemSpec));
FrameworkUtilities.cs (1)
85var _frameworks = frameworks.Select(s => NuGetFramework.Parse(s)).ToList();
GenerateNuSpec.cs (3)
319dependenciesById.Select(x => x.Version) 322dependenciesById.Select(x => x.Include).Aggregate(AggregateInclude), 323dependenciesById.Select(x => x.Exclude).Aggregate(AggregateExclude)
GeneratePackageReport.cs (9)
114CompileAssets = compileAssets.Select(c => GetPackageAssetFromTargetPath(c)).ToArray() 144CompileAssets = compileAssets.Select(c => GetPackageAssetFromTargetPath(c)).ToArray(), 145RuntimeAssets = runtimeAssets.Select(r => GetPackageAssetFromTargetPath(r)).ToArray(), 146NativeAssets = nativeAssets.Select(n => GetPackageAssetFromTargetPath(n)).ToArray() 175report.UnusedAssets = _unusedTargetPaths.Select(tp => GetPackageAssetFromTargetPath(tp)).ToArray(); 226var fileFrameworks = _targetPathToPackageItem.Values.Select(f => f.TargetFramework).Distinct(NuGetFramework.Comparer).Where(f => f != null); 236var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath"))); 336_resolver.AddPackageItems(packageId, packageItems[packageId].Select(f => f.TargetPath)); 345.Select(pf => pf.TargetPath)
GenerateRuntimeDependencies.cs (2)
98Log.LogMessage(LogImportance.Low, "Skipping dependencies {0} since they don't have a TargetRuntime.", String.Join(", ", runtimeGroup.Select(d => d.ItemSpec))); 119var dependencyVersions = dependencyGroup.Select(d => GetDependencyVersion(d));
GetApplicableAssetsFromPackageReports.cs (7)
78compileAssets.AddRange(target.CompileAssets.Select(c => ItemFromApplicableAsset(c, report.Id, report.Version))); 79buildProjects.AddRange(target.CompileAssets.Select(c => c.SourceProject).Where(bp => bp != null)); 80runtimeAssets.AddRange(target.RuntimeAssets.Select(r => ItemFromApplicableAsset(r, report.Id, report.Version))); 81buildProjects.AddRange(target.RuntimeAssets.Select(r => r.SourceProject).Where(bp => bp != null)); 82nativeAssets.AddRange(target.NativeAssets.Select(r => ItemFromApplicableAsset(r, report.Id, report.Version))); 83buildProjects.AddRange(target.NativeAssets.Select(r => r.SourceProject).Where(bp => bp != null)); 94BuildProjects = buildProjects.Distinct().Select(bp => bp.ToItem()).ToArray();
GetApplicableAssetsFromPackages.cs (13)
82NuGetFramework[] compileFxs = TargetMonikers.Select(fx => NuGetFramework.Parse(fx)).ToArray(); 87runtimeFxs = RuntimeTargetMonikers.Select(fx => NuGetFramework.Parse(fx)).ToArray(); 102.Select(ca => _targetPathToPackageItem[ca]); 104buildProjects.AddRange(compileItems.Select(ci => BuildProjectFromPackageItem(ci)).Where(bp => bp != null)); 106CompileAssets = compileItems.Select(ci => PackageItemAsResolvedAsset(ci)).ToArray(); 108Log.LogMessage($"Resolved compile assets from {compileFx.ToString()}: {String.Join(";", CompileAssets.Select(c => c.ItemSpec))}"); 115Log.LogError($"Could not locate compile assets for any of the frameworks {String.Join(";", compileFxs.Select(fx => fx.ToString()))}"); 126.Select(ra => _targetPathToPackageItem[ra]); 128buildProjects.AddRange(runtimeItems.Select(ri => BuildProjectFromPackageItem(ri)).Where(bp => bp != null)); 132Log.LogMessage($"Resolved runtime assets from {runtimeFx.ToString()}: {String.Join(";", RuntimeAssets.Select(r => r.ItemSpec))}"); 139Log.LogError($"Could not locate runtime assets for any of the frameworks {String.Join(";", runtimeFxs.Select(fx => fx.ToString()))}"); 142BuildProjects = buildProjects.Distinct().Select(bp => bp.ToItem()).ToArray(); 194_resolver.AddPackageItems(packageId, _packageToPackageItems[packageId].Select(f => f.TargetPath));
GetInboxFrameworks.cs (2)
57var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath"))); 59InboxFrameworks = index.GetInboxFrameworks(AssemblyName, AssemblyVersion).Select(fx => fx.GetShortFolderName()).ToArray();
GetLastStablePackage.cs (2)
125LastStablePackages = lastStablePackages.Select(p => CreateItem(originalItems[p.Key], p.Value)).ToArray(); 130var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath")));
GetMinimumNETStandard.cs (1)
31var minNETStandard = Frameworks.Select(fx => NuGetFramework.Parse(fx.ItemSpec))
GetPackageDestination.cs (1)
77SuppressPackageTargetFrameworkCompatibility.NullAsEmpty().Select(
GetPackageFromModule.cs (1)
44var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath")));
GetPackageVersion.cs (1)
37.Select(f => new Version(f.GetMetadata("AssemblyVersion")));
HarvestPackage.cs (6)
272.Select(f => new PackageItem(f)); 294var desktopRefVersions = liveDesktopDlls.Where(d => d.IsRef && d.Version != null).Select(d => d.Version); 295var desktopLibVersions = liveDesktopDlls.Where(d => !d.IsRef && d.Version != null).Select(d => d.Version); 510_pathsToExclude = new HashSet<string>(PathsToExclude.NullAsEmpty().Select(NormalizePath), StringComparer.OrdinalIgnoreCase); 534_pathsToSuppress = new HashSet<string>(PathsToSuppress.NullAsEmpty().Select(NormalizePath)); 616.Select(f => f.Substring(packageFolder.Length + 1).Replace('\\', '/'))
NuGetAssetResolver.cs (3)
59compileItems.Items.Select(ci => ci.Path) : 78runtimeItems.Items.Select(ci => ci.Path) : 215thisPackageCompileItems.Items.Select(ci => AsPackageSpecificTargetPath(referencePackageId, ci.Path)) :
NuGetPack.cs (4)
191return nuspecProperties == null ? null : NuspecPropertyStringProvider.GetNuspecPropertyProviderFunction(nuspecProperties.Select(p => p.ItemSpec).ToArray()); 370? _libPackageExcludes.Concat(AdditionalLibPackageExcludes?.Select(item => item.ItemSpec) ?? Enumerable.Empty<string>()) 371: LibPackageExcludes.Select(item => item.ItemSpec); 380.Concat(AdditionalSymbolPackageExcludes?.Select(item => item.ItemSpec) ?? Enumerable.Empty<string>());
PackageIndex.cs (3)
38packageIndexFiles.Select(packageIndexFile => new FileInfo(packageIndexFile)) 39.Select(packageIndexFileInfo => $"{packageIndexFileInfo.FullName}:{packageIndexFileInfo.Length}:{packageIndexFileInfo.LastWriteTimeUtc.Ticks}")); 288inboxFrameworks = info.InboxOn.GetInboxVersions().Where(p => p.Value >= assemblyVersion).Select(p => p.Key);
PromoteDependencies.cs (4)
42index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath"))); 46var dependencies = Dependencies.Select(d => new Dependency(d)).ToArray(); 51Log.LogMessage(LogImportance.Low, $"Ref frameworks {string.Join(";", refFxs.Select(f => f.ToString()))}"); 56Log.LogMessage(LogImportance.Low, $"Lib frameworks {string.Join(";", libFxs.Select(f => f.ToString()))}");
SplitDependenciesBySupport.cs (4)
29var dependencies = OriginalDependencies.Select(od => new Dependency(od)).ToArray(); 32List<ITaskItem> splitDependencies = new List<ITaskItem>(dependencies.Where(d => d.TargetFramework != null && d.TargetFramework.Framework != FrameworkConstants.FrameworkIdentifiers.NetStandard).Select(d => d.OriginalItem)); 43var netStandardGroups = dependencies.Select(d => d.TargetFramework) 55splitDependencies.AddRange(applicableDependencies.Select(d => d.GetItemWithTargetFramework(netStandardGroup)));
SplitReferences.cs (1)
60var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath")));
UpdatePackageIndex.cs (10)
97_packageIdsToInclude = new HashSet<string>(PackageIds.Select(i => i.ItemSpec), StringComparer.OrdinalIgnoreCase); 100foreach(var package in Packages.NullAsEmpty().Select(f => f.GetMetadata("FullPath"))) 106foreach(var packageFolder in PackageFolders.NullAsEmpty().Select(f => f.GetMetadata("FullPath"))) 121.Select(nuspec => Path.GetDirectoryName(nuspec)); 220var assemblyVersions = dlls.Select(f => VersionUtility.GetAssemblyVersion(f)); 221var dllNames = dlls.Select(f => Path.GetFileNameWithoutExtension(f)).Distinct(); 246assemblyVersions = dlls.Select(refFile => 257dllNames = dlls.Select(f => Path.GetFileNameWithoutExtension(f)).Distinct().ToArray(); 308.Select(pair => pair.Key); 317.Select(pair => pair.Key);
ValidatePackage.cs (17)
144.Select(r => r.TargetFramework) 146.Select(fx => fx.Version); 151.Select(vf => vf.Framework.Version); 186var compileAssetPaths = compileTarget.CompileAssets.Select(ca => ca.PackagePath); 202var runtimeAssetPaths = runtimeTarget.RuntimeAssets.Select(ra => ra.PackagePath); 352Log.LogError($"When targeting {target} {ContractName} will use {implementationAssembly.LocalPath} which targets {implementationAssembly.TargetFramework.GetShortFolderName()} but {String.Join(";", matchingFxAssets.Select(i => i.PackagePath))} targets {fx.GetShortFolderName()} specifically."); 363AllSupportedFrameworks = _frameworks.Values.Where(fx => fx.SupportedVersion != null).Select(fx => fx.ToItem()).OrderBy(i => i.ItemSpec).ToArray(); 378var index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath"))); 383Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is missing an entry for package {PackageId}. Please run /t:UpdatePackageIndex on this project to commit an update."); 389var assemblyVersions = new HashSet<Version>(allAssemblies.Select(f => VersionUtility.As4PartVersion(f.Version))); 400Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is missing an assembly version entry for {fileVersion} for package {PackageId}. Please run /t:UpdatePackageIndex on this project to commit an update."); 407Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} indicates that assembly version {fileVersion} is contained in non-stable package version {packageVersion} which differs from this package version {thisPackageVersion}."); 414.Select(pair => pair.Key); 417Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is has an assembly version entry(s) for {String.Join(", ", orphanedAssemblyVersions)} which are no longer in package {PackageId}. Please run /t:UpdatePackageIndex on this project to commit an update."); 430Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is missing an baseline entry(s) for native module {PackageId}. Please run /t:UpdatePackageIndex on this project to commit an update."); 437var moduleNames = allDlls.Select(d => Path.GetFileNameWithoutExtension(d.LocalPath)); 441Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is missing ModulesToPackages entry(s) for {String.Join(", ", missingModuleNames)} to package {PackageId}. Please add a an entry for the appropriate package.");
ValidationTask.cs (2)
126var valuesToAdd = valueString.Split(';').Select(v => v.Trim()); 150_index = PackageIndex.Load(PackageIndexes.Select(pi => pi.GetMetadata("FullPath")));
Microsoft.DotNet.Build.Tasks.Packaging.Tests (1)
CreateTrimDependencyGroupsTests.cs (1)
356var actualTFMs = task.TrimmedDependencies.Select(d => d.GetMetadata("TargetFramework"));
Microsoft.DotNet.Build.Tasks.TargetFramework (1)
TargetFrameworkResolver.cs (1)
57contentCollection.Load(frameworks.Select(f => f + '/').ToArray());
Microsoft.DotNet.Build.Tasks.VisualStudio (4)
OptProf\GetRunSettingsSessionConfiguration.cs (4)
125? config.Products.SelectMany(x => x.Tests.Select(y => y.Container + ".dll")) 129? config.Assemblies.SelectMany(x => x.Tests.Select(y => y.Container + ".dll")) 137.Select(x => $@" <TestContainer FileName=""{x}"" />")); 155.Select(x => $"FullyQualifiedName={x}"));
Microsoft.DotNet.Build.Tasks.VisualStudio.Tests (5)
Vsix\FinalizeInsertionVsixFile.cs (3)
60AssertEx.Equal(new[] { "PackageManifest.Installation element not found in manifest of 'x.vsix'" }, engine.Errors.Select(e => e.Message)); 84AssertEx.Equal(new[] { @"PackageManifest.Installation element of the manifest does not have Experimental=""true"": 'x.vsix'" }, engine.Warnings.Select(e => e.Message)); 118}, engine.Warnings.Select(e => e.Message));
Vsix\GetPkgDefAssemblyDependencyGuidTests.cs (2)
40}, task.OutputItems.Select(i => i.GetMetadata("SomeOutput"))); 62}, task.OutputItems.Select(i => i.GetMetadata("SomeOutput")));
Microsoft.DotNet.Build.Tasks.Workloads (4)
CreateVisualStudioWorkload.wix.cs (1)
289string uniquePackGroupKey = string.Join("\r\n", kvp.Value.Select(p => p.PackagePath).OrderBy(p => p));
Msi\MsiBase.wix.cs (1)
217SuppressIces = iceSuppressions == null ? null : string.Join(";", iceSuppressions.Select(i => i.ItemSpec))
Msi\WorkloadManifestMsi.wix.cs (1)
66foreach (var file in Directory.GetFiles(packageDataDirectory).Select(f => Path.GetFullPath(f)))
Msi\WorkloadPackGroupMsi.wix.cs (1)
95componentGroupRefElement.ReplaceWith(Enumerable.Range(1, _package.Packs.Count).Select(n => new XElement(ns + "ComponentGroupRef", new XAttribute("Id", "CG_PackageContents" + n))));
Microsoft.DotNet.Build.Tasks.Workloads.Tests (1)
MsiTests.cs (1)
103MsiUtils.GetAllDirectories(msiPath).Select(d => d.Directory).Should().NotContain("ManifestVersionDir");
Microsoft.DotNet.Deployment.Tasks.Links (5)
Microsoft.DotNet.GenAPI (1)
GenAPITask.cs (1)
411writer.ConditionalTypeLists = ConditionalTypeLists.Select(c =>
Microsoft.DotNet.GenFacades (6)
GenPartialFacadeSource.cs (2)
43ReferencePaths?.Select(item => item.ItemSpec).ToArray(), 45CompileFiles?.Select(item => item.ItemSpec).ToArray(),
GenPartialFacadeSourceGenerator.cs (3)
37string[] distinctSeeds = seeds.Select(seed => Path.GetFullPath(seed)).Distinct().ToArray(); 38string[] seedNames = distinctSeeds.Select(seed => Path.GetFileName(seed)).ToArray(); 44.Select(y => y.Key);
NotSupportedAssemblyGenerator.cs (1)
110_exclusionApis = exclusionApis?.Select(t => t.Substring(t.IndexOf(':') + 1));
Microsoft.DotNet.Helix.JobSender (3)
JobDefinition.cs (2)
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); 184_workItems.Select(async w =>
Payloads\DirectoryPayload.cs (1)
88.Select(file => file.LastWriteTimeUtc)
Microsoft.DotNet.Helix.Sdk (10)
CheckAzurePipelinesTestResults.cs (1)
223HashSet<string> expectedFailures = ExpectedTestFailures?.Select(i => i.GetMetadata("Identity")).ToHashSet() ?? new HashSet<string>();
CreateXHarnessAndroidWorkItems.cs (1)
60var tasks = Apks.Select(apk => PrepareWorkItem(zipArchiveManager, fileSystem, apk));
CreateXHarnessAppleWorkItems.cs (1)
82var tasks = AppBundles.Select(bundle => PrepareWorkItem(zipArchiveManager, fileSystem, provisioningProfileProvider, bundle));
CreateXUnitWorkItems.cs (1)
80XUnitWorkItems = (await Task.WhenAll(XUnitProjects.Select(PrepareWorkItem))).Where(wi => wi != null).ToArray();
DownloadFromResultsContainer.cs (1)
63await Task.WhenAll(WorkItems.Select(wi => DownloadFilesForWorkItem(wi, directory.FullName, _cancellationSource.Token)));
GetHelixWorkItems.cs (2)
34WorkItems = (await Task.WhenAll(Jobs.Select(j => GetWorkItemsAsync(j, cancellationToken))).ConfigureAwait(false)).SelectMany(r => r).ToArray(); 105.Select(file => new UploadedFile(file.Name, file.Link + "?access_token=" + AccessToken))
WaitForHelixJobCompletion.cs (3)
30List<(string jobName, string queueName, string jobCancellationToken)> jobNames = Jobs.Select(j => (j.GetMetadata("Identity"), j.GetMetadata("HelixTargetQueue"), j.GetMetadata("HelixJobCancellationToken"))).ToList(); 33await Task.WhenAll(jobNames.Select(n => WaitForHelixJobAsync(n.jobName, n.queueName, n.jobCancellationToken, cancellationToken))); 59string errorMsgs = string.Join(",", jd.Errors.Select(d => d.Message));
Microsoft.DotNet.Internal.DependencyInjection.Testing (1)
DependencyInjectionValidation.cs (1)
198return $"{baseName}<{string.Join(", ", type.GetGenericArguments().Select(GetDisplayName))}>";
Microsoft.DotNet.MacOsPkg.Tests (1)
UnpackPackTests.cs (1)
249.Select(f => (f.Substring(basePath.Length + 1), File.GetUnixFileMode(f)))
Microsoft.DotNet.NuGetRepack.Tests (10)
ReplacePackagePartsTests.cs (3)
39AssertEx.Equal(Array.Empty<string>(), engine.LogErrorEvents.Select(w => w.Message)); 40AssertEx.Equal(Array.Empty<string>(), engine.LogWarningEvents.Select(w => $"{w.Code}: {w.Message}")); 52}, archive.Entries.Select(e => e.FullName));
TestHelpers\AssertEx.cs (3)
320return string.Join(separator, list.Select(itemInspector)); 461var expectedString = string.Join(itemSeparator, expected.Select(itemInspector)); 462var actualString = string.Join(itemSeparator, actual.Select(itemInspector));
VersionUpdaterTests.cs (4)
25return package.Entries.Select(e => 142}, e2.InnerExceptions.Select(i => i.ToString())); 149}, e3.InnerExceptions.Select(i => i.ToString())); 156}, e4.InnerExceptions.Select(i => i.ToString()));
Microsoft.DotNet.PackageTesting (3)
NupkgParser.cs (1)
22.Select(dg => dg.TargetFramework)
Package.cs (2)
30List<NuGetFramework> FrameworksInPackageList = CompileAssets.Select(t => (NuGetFramework)t.Properties["tfm"]).ToList(); 33FrameworksInPackageList.AddRange(RuntimeAssets.Select(t => (NuGetFramework)t.Properties["tfm"]).Distinct());
Microsoft.DotNet.RemoteExecutor (4)
RemoteExecutor.cs (4)
539options.RuntimeConfigurationOptions.Select(kvp => $"\"{kvp.Key}\": {ToJsonString(kvp.Value)}")); 645.Select(frame => frame.GetMethod()?.ReflectedType?.Assembly) 650.Select(asm => System.IO.Path.Combine(AppContext.BaseDirectory, asm.GetName().Name + ".runtimeconfig.json")) 655.Select(asm => System.IO.Path.Combine(AppContext.BaseDirectory, asm.GetName().Name + ".deps.json"))
Microsoft.DotNet.SharedFramework.Sdk (9)
src\CreateFrameworkListFile.cs (3)
64?.Select(item => new XAttribute(item.ItemSpec, item.GetMetadata("Value"))) 81.Select(item => new 99.Select(g => g.First())
src\GeneratePlatformManifestEntriesFromFileList.cs (1)
36PlatformManifestEntries = entries.Select(entry =>
src\GeneratePlatformManifestEntriesFromTemplate.cs (1)
83PlatformManifestEntries = entries.Select(entry =>
src\GenerateSharedFrameworkDepsFile.cs (2)
102.Select(runtimeDict => runtimeGraph.ExpandRuntime(runtimeDict.Key)) 104.Select(expansion => new RuntimeFallbacks(expansion.First(), expansion.Skip(1))); // ExpandRuntime return runtime itself as first item.
src\ValidateFileVersions.cs (2)
79.Select(p => p.Value.File.ItemSpec) 86string.Concat(versionlessFiles.Select(f => Environment.NewLine + f)));
Microsoft.DotNet.SignCheck (2)
SignCheck.cs (1)
489await Task.WhenAll(uris.Select(u => DownloadFileAsync(u)));
SignCheckTask.cs (1)
114foreach (var checkFile in InputFiles.Select(s => s.ItemSpec).ToArray())
Microsoft.DotNet.SignCheckLibrary (1)
Verification\ExeVerifier.cs (1)
27if (PEHeader.ImageSectionHeaders.Select(s => s.SectionName).Contains(".wixburn"))
Microsoft.DotNet.SignTool (6)
src\BatchSignUtil.cs (2)
119var toRepackSet = _batchData.FilesToSign.Where(x => x.ShouldRepack)?.Select(x => x.FullPath)?.ToHashSet(); 186bool signResult = _signTool.Sign(_buildEngine, round, engines.Select(engine =>
src\Configuration.cs (1)
135_wixPacks = _itemsToSign.Where(w => WixPackInfo.IsWixPack(w.ItemSpec))?.Select(s => new WixPackInfo(s.ItemSpec)).ToList();
src\ContentUtil.cs (1)
128string.Join("", pktBytes.Select(b => b.ToString("x2")));
src\SignToolTask.cs (1)
280ItemsToSkipStrongNameCheck?.Select(i => i.ItemSpec).ToArray(),
src\ZipData.cs (1)
63.Select(entry => (entry.Name, entry.DataStream, entry.Length));
Microsoft.DotNet.SignTool.Tests (3)
SignToolTests.cs (3)
348var actualXmlElementsPerSigningRound = buildEngine.FilesToSign.Select(round => string.Join(Environment.NewLine, round)); 379engine.LogErrorEvents.Select(w => w.Message).Should().BeEquivalentTo(expectedErrors ?? Array.Empty<string>()); 380engine.LogWarningEvents.Select(w => $"{w.Code}: {w.Message}").Should().BeEquivalentTo(expectedWarnings ?? Array.Empty<string>());
Microsoft.DotNet.SourceBuild.Tasks (35)
src\ReadNuGetPackageInfos.cs (1)
29.Select(p =>
src\UsageReport\UsageData.cs (8)
26.Select(dir => new XElement("Dir", dir))), 31.Select(id => id.ToXElement())), 35.Select(p => p.ToXml())), 41.Select(u => u.ToXml()))); 49.Select(x => x.Value) 53.Select(XmlParsingHelpers.ParsePackageIdentity) 57.Select(UsagePattern.Parse) 61.Select(Usage.Parse)
src\UsageReport\ValidateUsageAgainstBaseline.cs (6)
80used.Usages.Select(u => u.GetIdentityWithoutRid()).Distinct(), 81baseline.Usages.Select(u => u.GetIdentityWithoutRid()).Distinct()); 93$"Package IDs are:{Environment.NewLine}" + string.Join(Environment.NewLine, diff.Added.Select(u => u.ToString()))); 101.Select(u => u.ToXml()))); 111report.Add(new XElement("Removed", diff.Removed.Select(id => id.ToXElement()))); 161.Select(p => p.CreateRegex())
src\UsageReport\WritePackageUsageData.cs (12)
110.Select(ReadNuGetPackageInfos.ReadIdentity) 115.Select(ReadNuGetPackageInfos.ReadIdentity) 120.Select(ReadNuGetPackageInfos.ReadIdentity) 125.Select(ReadNuGetPackageInfos.ReadIdentity) 132.Select(item => new PackageIdentity( 142.Select(GetPathRelativeToRoot) 143.Except(IgnoredProjectAssetsJsonFiles.NullAsEmpty().Select(GetPathRelativeToRoot)) 194.Select(t => ((JProperty)t).Name) 198var directDependencies = jObj.SelectTokens("$.project.frameworks.*.dependencies").Children().Select(dep => 227toCheck.Except(usages.Select(u => u.PackageIdentity))) 250?.Select(GetPathRelativeToRoot) 279.Select(o => o.Name)
src\UsageReport\WriteUsageReports.cs (5)
110.Select(usage => 157report.Add(annotatedUsages.Select(u => u.ToXml())); 171.Select(item => 202.Select(snapshot => 252.Select(x => new PackageVersionPropsElement(
src\WriteBuildOutputProps.cs (3)
55.Select(item => 63.Select(g => g.OrderBy(id => id.Version).Last()) 70.Select(dir => new {
Microsoft.DotNet.SourceBuild.Tasks.Tests (3)
ValidateUsageAgainstBaselineTests.cs (3)
28Usages = ids.Select(SimpleUsage).ToArray() 86baseline.Usages.Skip(1).Select(u => u.PackageIdentity).ToArray(), 87data.ActualUsageData.Usages.Select(u => u.PackageIdentity).ToArray());
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (9)
Languages\csharp\CSharp.cs (1)
22string ns = string.Join(".", parts.Select(p => Helpers.PascalCase(p.AsSpan())));
Modeler\ServiceClientModelFactory.cs (8)
125.SelectMany(p => p.Value.Operations.Select(o => (path: p.Key, type: o.Key, operation: o.Value))) 127.Select(g => CreateMethodGroupModel(g.Key, g)) 164.Select(CreateParameterModel) 179var selectedResponse = operation.Responses.Where(r => r.Key.StartsWith("2")).Select(p => p.Value).FirstOrDefault(); 206var schema = response.Content.Values.Select(t => t.Schema).FirstOrDefault(s => s != null); 274IList<string> enumeration = schema.Enum.OfType<OpenApiString>().Select(s => s.Value).ToList(); 378enumeration.Select(v => v)); 420? schema.Properties.Select(
Microsoft.DotNet.VersionTools (53)
Automation\DependencyUpdateResults.cs (2)
28string updatedDependencyNames = string.Join(", ", orderedInfos.Select(d => d.SimpleName)); 29string updatedDependencyVersions = string.Join(", ", orderedInfos.Select(d => d.SimpleVersion));
Automation\DependencyUpdateUtils.cs (1)
25.Select(task =>
Automation\GitHubApi\GitHubClient.cs (1)
248IEnumerable<long> allIds = queryResponse.Items.Select(item => item.Id);
Automation\PullRequestCreator.cs (2)
185.Select(CiStatusLine.Create) 195.Select(g => $"{g.Count()}{g.Key}")
Automation\VersionsRepoUpdater.cs (3)
28.Select(path => _nupkgInfoFactory.CreateNupkgInfo(path)); 42.Select(t => $"{t.Key} {t.Value}")); 96.Select(t => t.Prerelease)
Automation\VstsApi\VstsAdapterClient.cs (2)
208.Select(o => new GitHubPullRequest 235IEnumerable<int> allIds = prs.Select(pr => pr.Number);
BuildInfo.cs (1)
212.Select(versionString => new NuGetVersion(versionString));
BuildManifest\BuildManifestClient.cs (5)
151.Select(async g => new 164.Select(g => g.Group.JoinSemaphorePath) 169.Select(p => new SupplementaryUploadRequest 226.Select(upload => new GitObject 286remainingSemaphores.Select(
BuildManifest\Model\ArtifactSet.cs (4)
27.Select(p => p.ToXml()), 30.Select(b => b.ToXml())); 34Packages = xml.Elements("Package").Select(PackageArtifactModel.Parse).ToList(), 35Blobs = xml.Elements("Blob").Select(BlobArtifactModel.Parse).ToList(),
BuildManifest\Model\OrchestratedBuildModel.cs (4)
45Endpoints.Select(x => x.ToXml()), 46Builds.Select(x => x.ToXmlBuildElement())); 50Endpoints = xml.Elements("Endpoint").Select(EndpointModel.Parse).ToList(), 51Builds = xml.Elements("Build").Select(BuildIdentity.Parse).ToList()
BuildManifest\Model\SigningInformationModel.cs (10)
42.Select(fe => fe.ToXml()), 47.Select(f => f.ToXml())) 52.Select(f => f.ToXml())) 55.Select(i => i.ToXml())) 60.Select(s => s.ToXml()))); 67FileExtensionSignInfo = xml.Elements("FileExtensionSignInfo").Select(FileExtensionSignInfoModel.Parse) 69FileSignInfo = xml.Elements("FileSignInfo").Select(FileSignInfoModel.Parse) 71ItemsToSign = xml.Elements("ItemsToSign").Select(ItemToSignModel.Parse).ToList(), 72StrongNameSignInfo = xml.Elements("StrongNameSignInfo").Select(StrongNameSignInfoModel.Parse) 74CertificatesSignInfo = xml.Elements("CertificatesSignInfo").Select(CertificatesSignInfoModel.Parse)
BuildManifest\Model\SigningInformationParsingExtensions.cs (4)
60$"Some extensions have conflicting FileExtensionSignInfo: {string.Join(", ", conflicts.Select(s => s.Key))}"); 118$"The following files have conflicting FileSignInfo entries: {string.Join(", ", conflicts.Select(s => s.Key.Substring(0, s.Key.IndexOf("/"))))}"); 176$"Some certificates have conflicting DualSigningAllowed entries: {string.Join(", ", conflicts.Select(s => s.Key))}"); 223$"Some public key tokens have conflicting StrongNameSignInfo entries: {string.Join(", ", conflicts.Select(s => s.Key))}");
BuildManifest\Model\XElementParsingExtensions.cs (1)
37.Select(pair => new XAttribute(pair.Key, pair.Value))
Dependencies\BuildManifest\OrchestratedBuildIdentityMatch.cs (1)
21.Select(b => new OrchestratedBuildIdentityMatch { Info = info, Match = b }))
Dependencies\BuildOutput\BuildDependencyInfo.cs (1)
46.Select(pair => new PackageIdentity(pair.Key, new NuGetVersion(pair.Value)))
Dependencies\BuildOutput\OrchestratedBuild\OrchestratedBuildUpdateHelpers.cs (2)
43.Select(info => 64.Select(info =>
Dependencies\BuildOutput\ProjectJsonUpdater.cs (4)
51dependencyChanges.Select(change => change.Info), 52dependencyChanges.Select(change => $"In '{projectJsonFile}', {change.ToString()}"))); 72.Select(dependencyProperty => ReplaceDependencyVersion(projectJsonFile, dependencyProperty, buildInfos)) 153.Select(property => property.Value)
Dependencies\BuildOutput\ToolVersionsUpdater.cs (2)
50lineResults.Select(c => c.UsedInfo), 51lineResults.Select(c => $"In '{Path}', '{c.ToolName}' '{c.OriginalVersion}' must be '{c.NewVersion}'."));
Dependencies\FileRegexUpdater.cs (1)
54$"'{string.Join(", ", usedInfos.Select(info => info.SimpleName))}'"
Dependencies\FileUpdater.cs (1)
56.Select(c =>
Util\GitCommand.cs (1)
44var logArgs = args.Select(arg => arg == repository ? redactedRepository : arg);
Microsoft.DotNet.VersionTools.Tasks (6)
BaseDependenciesTask.cs (1)
92yield return new ProjectJsonUpdater(ProjectJsonFiles.Select(item => item.ItemSpec));
LocalUpdatePublishedVersions.cs (1)
68ShippedNuGetPackage.Select(i => i.ItemSpec),
SubmitPullRequest.cs (1)
109body += PullRequestCreator.NotificationString(NotifyGitHubUsers.Select(item => item.ItemSpec));
TraceListenerCollectionExtensions.cs (1)
32.Select(type => new MsBuildTraceListener(log, type))
UpdatePublishedVersions.cs (1)
46ShippedNuGetPackage.Select(item => item.ItemSpec),
UpdateToRemoteDependencies.cs (1)
76.Select(info =>
Microsoft.DotNet.XliffTasks (2)
Model\XamlRuleDocument.cs (1)
198foreach (string? line in comment.Value.Split(new[] { '\n' }, System.StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()))
Model\XlfDocument.cs (1)
285.Select(tu => tu.GetId()));
Microsoft.DotNet.XUnitExtensions (3)
Extensions\TheoryExtensions.cs (1)
21return new TheoryDataAdapter(data.Select(d => new object[] { d }));
XunitParallelTheoryTestCaseRunner.cs (2)
99methodToRun = methodToRun.MakeGenericMethod(resolvedTypes.Select(t => ((IReflectionTypeInfo)t).Type).ToArray()); 102Type[] parameterTypes = methodToRun.GetParameters().Select(p => p.ParameterType).ToArray();
Microsoft.Extensions.AI (3)
ChatCompletion\OpenTelemetryChatClient.cs (2)
255_ = activity.AddTag(OpenTelemetryConsts.GenAI.Request.StopSequences, $"[{string.Join(", ", stopSequences.Select(s => $"\"{s}\""))}]"); 511var toolCalls = message.Contents.OfType<FunctionCallContent>().Select(fc => new ToolCall
Embeddings\CachingEmbeddingGenerator.cs (1)
90var uncachedResults = await base.GenerateAsync(uncached.Select(e => e.Input), options, cancellationToken).ConfigureAwait(false);
Microsoft.Extensions.AI.Abstractions (1)
Utilities\AIJsonUtilities.Schema.cs (1)
294requiredArray = [.. propertiesObj.Select(prop => (JsonNode)prop.Key)];
Microsoft.Extensions.AI.Abstractions.Tests (8)
AssertExtensions.cs (1)
42.Select(e => $"'{e.Key}'")
ChatCompletion\ChatMessageTests.cs (1)
95Assert.Equal(string.Concat(Enumerable.Range(0, messageCount).Select(i => $"text-{i}")), message.ToString());
Embeddings\EmbeddingGeneratorExtensionsTests.cs (3)
49string[] inputs = Enumerable.Range(0, count).Select(i => $"hello {i}").ToArray(); 52.Select(i => new Embedding<float>(Enumerable.Range(i, 4).Select(i => (float)i).ToArray()))
test\Shared\JsonSchemaExporter\SchemaTestHelpers.cs (1)
38.SelectMany(d => d.Errors!.Select(error => $"Path:${d.InstanceLocation} {error.Key}:{error.Value}"));
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
35public static IEnumerable<object[]> GetTestData() => GetTestDataCore().Select(t => new object[] { t }); 40.Select(t => new object[] { t });
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceEmbeddingGenerator.cs (1)
92GeneratedEmbeddings<Embedding<float>> result = new(embeddings.Data.Select(e =>
Microsoft.Extensions.AI.AzureAIInference.Tests (5)
AzureAIInferenceChatClientTests.cs (4)
150[new ChatMessage(ChatRole.User, "hello".Select(c => (AIContent)new TextContent(c.ToString())).ToList())] : 217[new ChatMessage(ChatRole.User, "hello".Select(c => (AIContent)new TextContent(c.ToString())).ToList())] : 230Assert.Equal("Hello! How can I assist you today?", string.Concat(updates.Select(u => u.Text))); 862Assert.Equal("", string.Concat(updates.Select(u => u.Text)));
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
42.Select(e => $"'{e.Key}'")
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (2)
286Tools = options?.Tools is { Count: > 0 } tools ? tools.OfType<AIFunction>().Select(ToOllamaTool) : null, 467Required = function.Metadata.Parameters.Where(p => p.IsRequired).Select(p => p.Name).ToList(),
Microsoft.Extensions.AI.Ollama.Tests (3)
OllamaChatClientTests.cs (2)
184DateTimeOffset[] createdAts = Regex.Matches(Output, @"2024.*?Z").Cast<Match>().Select(m => DateTimeOffset.Parse(m.Value)).ToArray(); 195Assert.Equal("Hello! How are you today? Is there something I can help you with or would you like to", string.Concat(updates.Select(u => u.Text)));
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
42.Select(e => $"'{e.Key}'")
Microsoft.Extensions.AI.OpenAI (3)
OpenAIEmbeddingGenerator.cs (1)
118return new(embeddings.Select(e =>
OpenAIModelMapper.ChatMessage.cs (1)
60string textContent = string.Join(string.Empty, toolMessage.Content.Where(part => part.Kind is ChatMessageContentPartKind.Text).Select(part => part.Text));
OpenAIRealtimeExtensions.cs (1)
39.Select(p => p.Name),
Microsoft.Extensions.AI.OpenAI.Tests (3)
OpenAIChatClientTests.cs (2)
264Assert.Equal("Hello! How can I assist you today?", string.Concat(updates.Select(u => u.Text))); 855Assert.Equal("", string.Concat(updates.Select(u => u.Text)));
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
42.Select(e => $"'{e.Key}'")
Microsoft.Extensions.AI.Tests (8)
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
38var expectedUpdates = Enumerable.Range(0, 3).Select(i => new StreamingChatCompletionUpdate()).ToArray();
ChatCompletion\DistributedCachingChatClientTest.cs (1)
717=> ToAsyncEnumerableAsync(preTask, valueFactories.Select<T, Func<T>>(v => () => v));
Embeddings\DistributedCachingEmbeddingGeneratorTest.cs (5)
235return [new(((string)options!.AdditionalProperties!["someKey"]!).Select(c => (float)c).ToArray())]; 255AssertEmbeddingsEqual(new("value 1".Select(c => (float)c).ToArray()), result1); 256AssertEmbeddingsEqual(new("value 1".Select(c => (float)c).ToArray()), result2); 270AssertEmbeddingsEqual(new("value 1".Select(c => (float)c).ToArray()), result3); 271AssertEmbeddingsEqual(new("value 2".Select(c => (float)c).ToArray()), result4);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
42.Select(e => $"'{e.Key}'")
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.cs (1)
26private static readonly char[] _keyReservedCharacters = Enumerable.Range(0, 32).Select(i => (char)i).ToArray();
Microsoft.Extensions.Caching.Hybrid.Tests (1)
LogCollector.cs (1)
60Assert.Equal(string.Join(",", errorIds), string.Join(",", _items.Select(static x => x.eventId.Id)));
Microsoft.Extensions.Compliance.Testing.Tests (2)
FakeRedactorTests.cs (2)
92var sequenceNumbersRedacted = fakeRedactorProvider.Collector.AllRedactedData.Select(x => x.SequenceNumber); 93var sequenceNumbersRequested = fakeRedactorProvider.Collector.AllRedactorRequests.Select(x => x.SequenceNumber);
Microsoft.Extensions.Configuration (1)
InternalConfigurationRootExtensions.cs (1)
30.Select(key => root.GetSection(path == null ? key : path + ConfigurationPath.KeyDelimiter + key));
Microsoft.Extensions.Configuration.Binder (1)
ConfigurationBinder.cs (1)
229HashSet<string> propertyNames = new(modelProperties.Select(mp => mp.Name),
Microsoft.Extensions.Configuration.KeyPerFile.Tests (2)
ConfigurationProviderTestBase.cs (2)
331var root = new ConfigurationRoot(providers.Select(e => e.Provider).ToList()); 333foreach (var initializer in providers.Select(e => e.Initializer))
Microsoft.Extensions.DependencyInjection (1)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (1)
145callSite.ServiceCallSites.Select(cs =>
Microsoft.Extensions.DependencyModel (6)
DependencyContextExtensions.cs (2)
98return ResolveAssets(context, string.Empty, self.RuntimeAssemblyGroups).Select(GetAssemblyName); 107return ResolveAssets(context, runtimeIdentifier, self.RuntimeAssemblyGroups).Select(GetAssemblyName);
DependencyContextJsonReader.cs (2)
789.Select(e => new RuntimeFile(e.Path, e.AssemblyVersion, e.FileVersion)) 801.Select(e => new RuntimeFile(e.Path, e.AssemblyVersion, e.FileVersion))
RuntimeAssetGroup.cs (2)
45return _runtimeFiles!.Select(file => file.Path).ToArray(); 61return _assetPaths!.Select(path => new RuntimeFile(path, null, null)).ToArray();
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (3)
HealthCheckPublisherHostedServiceTest.cs (3)
386var entries = publisher.Entries.SelectMany(e => e.report.Entries.Select(e2 => e2.Key)).OrderBy(k => k).ToArray(); 641var entries = publishers[i].Entries.SelectMany(e => e.report.Entries.Select(e2 => e2.Key)).OrderBy(k => k).ToArray(); 657var entries = publishers[i].Entries.SelectMany(e => e.report.Entries.Select(e2 => e2.Key)).OrderBy(k => k).ToArray();
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Windows\Network\WindowsTcpStateInfo.cs (2)
34.Select(s => (uint)IPAddress.Parse(s).Address) 39.Select(s => IPAddress.Parse(s).GetAddressBytes())
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\MetricCollector.cs (1)
112var str = string.Join(", ", _supportedTs.Select(t => t.Name).ToArray());
Microsoft.Extensions.FileProviders.Embedded.Tests (3)
Manifest\TestEntry.cs (1)
25new XElement("Directory", new XAttribute("Name", Name), Children.Select(c => c.ToXElement()));
TestAssembly.cs (2)
36new XElement("FileSystem", entry.Children.Select(c => c.ToXElement())))); 45Files = entry.GetFiles().Select(f => f.ResourcePath).ToArray();
Microsoft.Extensions.FileProviders.Physical (1)
PhysicalDirectoryInfo.cs (1)
92.Select<FileSystemInfo, IFileInfo>(info => info switch
Microsoft.Extensions.FileSystemGlobbing (2)
Internal\MatcherContext.cs (2)
42_includePatternContexts = includePatterns.Select(pattern => pattern.CreatePatternContextForInclude()).ToArray(); 43_excludePatternContexts = excludePatterns.Select(pattern => pattern.CreatePatternContextForExclude()).ToArray();
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\HttpClientLoggingTagNamesTest.cs (1)
28.Select(f => (string)f.GetValue(null)!)
Logging\Internal\RandomStringGenerator.cs (1)
20.Select(s => s[_random.Next(s.Length)]).ToArray());
Microsoft.Extensions.Http.Resilience.PerformanceTests (2)
HttpClientFactory.cs (2)
82options.Groups = Enumerable.Repeat(0, routes).Select(_ => 105options.Groups = Enumerable.Repeat(0, routes).Select(_ =>
Microsoft.Extensions.Http.Resilience.Tests (3)
Routing\OrderedRoutingStrategyTest.cs (1)
109return CreateGroup(endpoints.Select(v => new WeightedUriEndpoint { Uri = new Uri(v) }).ToArray());
Routing\RoutingStrategyTest.cs (1)
168return new ConfigurationBuilder().AddInMemoryCollection(values.Select(pair => new KeyValuePair<string, string?>("section:" + pair.Key, pair.Value))).Build().GetSection("section");
Routing\WeightedRoutingStrategyTest.cs (1)
169return CreateGroup(endpoints.Select(v => new WeightedUriEndpoint { Uri = new Uri(v) }).ToArray());
Microsoft.Extensions.Identity.Core (4)
IdentityResult.cs (1)
74string.Format(CultureInfo.InvariantCulture, "{0} : {1}", "Failed", string.Join(",", Errors.Select(x => x.Code).ToList()));
RoleManager.cs (1)
413Logger.LogWarning(LoggerEventIds.RoleValidationFailed, "Role {roleId} validation failed: {errors}.", await GetRoleIdAsync(role).ConfigureAwait(false), string.Join(";", errors.Select(e => e.Code)));
UserManager.cs (2)
2323Logger.LogDebug(LoggerEventIds.UserValidationFailed, "User validation failed: {errors}.", string.Join(";", errors.Select(e => e.Code))); 2359Logger.LogDebug(LoggerEventIds.PasswordValidationFailed, "User password validation failed: {errors}.", string.Join(";", errors?.Select(e => e.Code) ?? Array.Empty<string>()));
Microsoft.Extensions.Options.Contextual.Tests (1)
AcceptanceTests.cs (1)
58return Enumerable.Range(1, options.ForecastDays).Select(index => new WeatherForecast
Microsoft.Extensions.Options.SourceGeneration (3)
Parser.cs (3)
202.Select(m => (IMethodSymbol)m) 277var addedMembers = new HashSet<string>(members.Select(m => m.Name)); 288addedMembers.UnionWith(baseMembers.Select(m => m.Name));
Microsoft.Extensions.ServiceDiscovery (2)
ServiceEndpointWatcher.Log.cs (1)
25ResolutionSucceededCore(logger, endpointSource.Endpoints.Count, serviceName, string.Join(", ", endpointSource.Endpoints.Select(GetEndpointString)));
ServiceEndpointWatcherFactory.Log.cs (1)
19ServiceEndpointProviderListCore(logger, serviceName, providers.Count, string.Join(", ", providers.Select(static r => r.ToString())));
Microsoft.Extensions.Telemetry (1)
Logging\ExtendedLoggerFactory.cs (1)
76_enrichers = enrichers.Select<ILogEnricher, Action<IEnrichmentTagCollector>>(e => e.Enrich).ToArray();
Microsoft.Extensions.Telemetry.Tests (2)
Enrichment\ApplicationEnricherTagTests.cs (1)
29.Select(f => (string)f.GetValue(null)!)
Enrichment\ProcessEnricherDimensionsTests.cs (1)
28.Select(f => (string)f.GetValue(null)!)
Microsoft.Gen.ContextualOptions (11)
ContextReceiver.cs (1)
47.SelectMany(declarations => declarations.Select(declaration => (symbol: compilation.GetSemanticModel(declarations.Key).GetDeclaredSymbol(declaration), declaration)))
ContextualOptionsGenerator.cs (1)
39.SelectMany(declarations => declarations.Select(declaration => (symbol: compilation.GetSemanticModel(declarations.Key).GetDeclaredSymbol(declaration), declaration)))
Emitter.cs (1)
38{{{string.Concat(optionsContextType.OptionsContextProperties.OrderBy(x => x).Select(property => $@"
Parser.cs (8)
18.Select(type => new OptionsContextType(type.Key, type.Value.ToImmutableArray(), GetContextProperties(type.Key))) 19.Select(CheckInstantiable) 20.Select(CheckPartial) 21.Select(CheckRefLikeType) 22.Select(CheckHasProperties); 32.Select(modifier => Diagnostic.Create(DiagDescriptors.ContextCannotBeStatic, modifier.GetLocation(), type.Name))); 46.Select(modifier => Diagnostic.Create(DiagDescriptors.ContextCannotBeRefLike, modifier.GetLocation(), type.Name))); 87.Select(prop => prop.Name)
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
EmitterTests.cs (2)
68.Select(statement => statement.ToString()); 97.Select(statement => statement.ToString());
SyntaxContextReceiverTests.cs (1)
75Assert.All(declaration.Value.Select(dec => dec.Identifier.Text), className => Assert.Equal("Class2", className));
Microsoft.Gen.Logging (9)
Emission\Emitter.Method.cs (3)
77var stateName = PickUniqueName("state", lm.Parameters.Select(p => p.ParameterName)); 276var tmpVarName = PickUniqueName("tmp", lm.Parameters.Select(p => p.ParameterName)); 624OutEnumeration(lm.Parameters.Select(static p =>
Parsing\Parser.cs (3)
476.Select(static x => x!) 498var fullName = string.Join("_", chain.Concat(new[] { leaf }).Select(static x => x.TagName)); 562.Select(x => x!.ToDisplayString()));
Parsing\Parser.LogProperties.cs (3)
166classification.UnionWith(GetDataClassificationAttributes(current, symbols).Select(x => x.ToDisplayString())); 170classification.UnionWith(GetDataClassificationAttributes(property, symbols).Select(x => x.ToDisplayString())); 175classification.UnionWith(dataClassesFromCtor.Select(x => x.ToDisplayString()));
Microsoft.Gen.Metrics.Generated.Tests (30)
MetricTests.cs (22)
71Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 154Assert.Equal(new (string, object?)[] { ("s1", "val_1"), ("s2", "val_2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 174var tags = measurements[0].Tags.Select(x => (x.Key, x.Value)); 177tags = measurements[1].Tags.Select(x => (x.Key, x.Value)); 198var tags = measurements[0].Tags.Select(x => (x.Key, x.Value)); 201tags = measurements[1].Tags.Select(x => (x.Key, x.Value)); 253Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 259Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 266Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val4") }, measurement.Tags.Select(x => (x.Key, x.Value))); 278Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 284Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 291Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val4") }, measurement.Tags.Select(x => (x.Key, x.Value))); 329Assert.Equal(new (string, object?)[] { ("Dim1", "val1"), ("Dim_2", "val2"), ("Dim_3", "val3") }, measurement.Tags.Select(x => (x.Key, x.Value))); 342Assert.Equal(new (string, object?)[] { ("Dim1", "val1"), ("Dim_2", "val2"), ("Dim_3", "val3") }, measurement.Tags.Select(x => (x.Key, x.Value))); 372measurement.Tags.Select(x => (x.Key, x.Value))); 421measurement.Tags.Select(x => (x.Key, x.Value))); 444measurement.Tags.Select(x => (x.Key, x.Value))); 467measurement.Tags.Select(x => (x.Key, x.Value))); 515measurement.Tags.Select(x => (x.Key, x.Value))); 564measurement.Tags.Select(x => (x.Key, x.Value))); 587measurement.Tags.Select(x => (x.Key, x.Value))); 609measurement.Tags.Select(x => (x.Key, x.Value)));
MetricTests.Ext.cs (8)
55Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 135Assert.Equal(new (string, object?)[] { ("s1", "val_1"), ("s2", "val_2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 184measurement.Tags.Select(x => (x.Key, x.Value))); 206measurement.Tags.Select(x => (x.Key, x.Value))); 228measurement.Tags.Select(x => (x.Key, x.Value))); 277measurement.Tags.Select(x => (x.Key, x.Value))); 299measurement.Tags.Select(x => (x.Key, x.Value))); 321measurement.Tags.Select(x => (x.Key, x.Value)));
Microsoft.Gen.MetricsReports (2)
MetricsReportsGenerator.cs (2)
102.Select(meteringClass => new ReportedMetricClass( 107Methods: meteringClass.Methods.Select(meteringMethod => new ReportedMetricMethod(
Microsoft.Interop.ComInterfaceGenerator (15)
AttributeInfo.cs (1)
19return Attribute((NameSyntax)Type.Syntax, AttributeArgumentList(SeparatedList(Arguments.Select(arg => AttributeArgument(ParseExpression(arg))))));
ComInterfaceGenerator.cs (8)
484var shadowImplementations = interfaceGroup.InheritedMethods.Select(m => (Method: m, ManagedToUnmanagedStub: m.ManagedToUnmanagedStub)) 486.Select(ctx => ((GeneratedStubCodeContext)ctx.ManagedToUnmanagedStub).Stub.Node 489var inheritedStubs = interfaceGroup.InheritedMethods.Select(m => m.UnreachableExceptionStub); 495.Select(m => m.ManagedToUnmanagedStub) 497.Select(ctx => ctx.Stub.Node) 509.Select(m => m.UnmanagedToManagedStub) 512.Select(context => context.Stub.Node))); 614.Select(context => context.GenerationContext),
ComMethodContext.cs (2)
133.WithAttributeLists(List(GenerationContext.SignatureContext.AdditionalAttributes.Concat(MethodInfo.Attributes.Select(a => a.GenerateAttributeList())))) 144SeparatedList(GenerationContext.SignatureContext.ManagedParameters.Select(GenerateArgument))))))
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (2)
40.Select(solution.GetProject) 42return (await Task.WhenAll(sortedProjects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(diag => diag).ToImmutableArray();
VirtualMethodPointerStubGenerator.cs (2)
104functionPointerParameters.AddRange(paramList.Parameters.Select(p => FunctionPointerParameter(attributeLists: default, p.Modifiers, p.Type))); 273functionPointerParameters.AddRange(paramList.Parameters.Select(p => FunctionPointerParameter(p.Type)));
Microsoft.Interop.JavaScript.JSImportGenerator (4)
JSGeneratorFactory.cs (1)
89return Create(info, context, isToJs, function.KnownType, function.ArgsTypeInfo.Select(a => a.KnownType).ToArray(), jsMarshalingInfo.JSType, jsMarshalingInfo.JSTypeArguments, fail);
JSMarshalAsAttributeInfoParser.cs (1)
35foreach (var ta in jsTypeArgs.TypeArguments.Cast<INamedTypeSymbol>().Select(x => x.ToDisplayString()))
Marshaling\FuncJSGenerator.cs (2)
28var args = _argumentMarshalerTypes.Select(x => Argument(MarshalerTypeName(x))).ToList(); 45.Select(a => a.Syntax)
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
96return ImmutableArray.CreateRange((await Task.WhenAll(context.Solution.Projects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(arr => arr));
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (2)
40.Select(solution.GetProject) 42return (await Task.WhenAll(sortedProjects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(diag => diag).ToImmutableArray();
Microsoft.Interop.SourceGeneration (5)
BoundGenerators.cs (1)
138.Select(static info => GetInfoIndex(info)).ToImmutableArray();
DiagnosticInfo.cs (3)
34MessageArgs = messageArgs.Select(o => o?.ToString()).ToSequenceEqualImmutableArray() 46MessageArgs = messageArgs.Select(o => o.ToString()).ToSequenceEqualImmutableArray() 58MessageArgs = messageArgs.Select(o => o.ToString()).ToSequenceEqualImmutableArray()
MethodSignatureDiagnosticLocations.cs (1)
48: this(syntax.Identifier.Text, syntax.ParameterList.Parameters.Select(p => p.Identifier.GetLocation()).ToImmutableArray(), syntax.Identifier.GetLocation())
Microsoft.JSInterop.Tests (1)
JSInProcessRuntimeTest.cs (1)
83Assert.Equal(new[] { obj2, obj1 }, syncResult.Select(r => r.Value));
Microsoft.Maui (2)
HotReload\HotReloadHelper.cs (2)
165 var t = assemblies.Select(x => x.GetType(oldViewType)).FirstOrDefault(x => x != null); 167 var views = HandlerService!.Where(x => x.ImplementationType == t).Select(x => new KeyValuePair<Type, Type>(x.ServiceType, x.ImplementationType!)).ToList();
Microsoft.Maui.Controls (9)
ColumnDefinitionCollectionTypeConverter.cs (1)
43 return string.Join(", ", cdc.Select(cd => converter.ConvertToInvariantString(cd.Width)));
FormattedString.cs (1)
37 public override string ToString() => string.Concat(Spans.Select(span => span.Text));
ListStringTypeConverter.cs (1)
26 return strValue.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToList();
MergedStyle.cs (1)
130 ClassStyles = _classStyleProperties.Select(p => (Target.GetValue(p) as IList<Style>)?.FirstOrDefault(s => s.CanBeAppliedTo(TargetType))).ToList();
Platform\iOS\Extensions\BrushExtensions.cs (1)
212 return gradientStops.Select(x => new NSNumber(x.Offset)).ToArray();
RowDefinitionCollectionTypeConverter.cs (1)
42 return string.Join(", ", rdc.Select(rd => converter.ConvertToInvariantString(rd.Height)));
Shapes\PointCollectionConverter.cs (1)
67 return string.Join(", ", pc.Select(p => converter.ConvertToInvariantString(p)));
Shapes\Shape.cs (1)
187 => StrokeDashArray.Select(a => (float)a).ToArray();
TemplatedItemsList.cs (1)
1305 newList.AddRange(list.Cast<TemplatedItemsList<TView, TItem>>().Select(tl => tl.ShortName));
Microsoft.Maui.Controls.Build.Tasks (16)
BuildException.cs (1)
23 MessageArgs = args?.Select(a => a?.ToString()).ToArray();
CompiledConverters\CornerRadiusTypeConverter.cs (1)
43 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui", "Microsoft.Maui", "CornerRadius"), parameterTypes: args.Select(a => ("mscorlib", "System", "Double")).ToArray()));
CompiledConverters\ListStringTypeConverter.cs (1)
23 var parts = value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToList();
CompiledConverters\ThicknessTypeConverter.cs (1)
48 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui", "Microsoft.Maui", "Thickness"), parameterTypes: args.Select(a => ("mscorlib", "System", "Double")).ToArray()));
DebugXamlCTask.cs (1)
24 var paths = ReferencePath.Select(p => IOPath.GetDirectoryName(p.Replace("//", "/"))).Distinct();
ModuleDefinitionExtensions.cs (8)
16 return cache.GetOrAddTypeReference(module, typeKey, x => module.ImportReference(module.ImportReference(cache, type).MakeGenericInstanceType(classArguments.Select(gp => module.GetTypeDefinition(cache, (gp.assemblyName, gp.clrNamespace, gp.typeName))).ToArray()))); 38 var ctorKey = $"{type}.ctor({(parameterTypes == null ? "" : string.Join(",", parameterTypes.Select(SerializeTypeReference)))})"; 65 return cache.GetOrAddMethodReference(module, ctorKey, x => x.module.ImportCtorReference(cache, x.module.GetTypeDefinition(cache, type), classArguments.Select(args => x.module.GetTypeDefinition(cache, args)).ToArray(), md => md.Parameters.Count == paramCount)); 70 var ctorKey = $"{type}<{string.Join(",", classArguments.Select(SerializeTypeReference))}>.ctor({(string.Join(",", Enumerable.Repeat("_", paramCount)))})"; 77 return cache.GetOrAddMethodReference(module, ctorKey, x => x.module.ImportCtorReference(cache, x.module.GetTypeDefinition(cache, type), classArguments.Select(args => x.module.GetTypeDefinition(cache, args)).ToArray(), md => 209 classArguments: classArguments?.Select(gp => x.module.GetTypeDefinition(cache, (gp.assemblyName, gp.clrNamespace, gp.typeName))).ToArray())); 232 classArguments: classArguments?.Select(gp => x.module.GetTypeDefinition(cache, (gp.assemblyName, gp.clrNamespace, gp.typeName))).ToArray())); 295 return gitr == null ? serialized : $"{serialized}<{string.Join(",", gitr.GenericArguments.Select(SerializeTypeReference))}>";
NodeILExtensions.cs (1)
337 return (requireServiceAttribute?.ConstructorArguments[0].Value as CustomAttributeArgument[])?.Select(ca => ca.Value as TypeReference).ToArray();
XamlCTask.cs (1)
182 var paths = ReferencePath.Select(p => IOPath.GetDirectoryName(p.Replace("//", "/"))).Distinct();
XmlTypeExtensions.cs (1)
87 type = module.ImportReference(type).MakeGenericInstanceType(typeArguments.Select(x => x.GetTypeReference(cache, module, xmlInfo)).ToArray());
Microsoft.Maui.Controls.Compatibility (6)
Tizen\Extensions\BrushExtensions.cs (4)
95 var gradientColors = orderedGradientStops.Select(x => x.Color.ToNativeEFL().ToSKColor()).ToArray(); 96 var gradientColorPos = orderedGradientStops.Select(x => x.Offset).ToArray(); 105 var gradientColors = orderedGradientStops.Select(x => x.Color.ToNativeEFL().ToSKColor()).ToArray(); 106 var gradientColorPos = orderedGradientStops.Select(x => x.Offset).ToArray();
Tizen\Forms.cs (1)
419 return _results.Select(o => o as T).ToList();
Tizen\Renderers\NavigationPageRenderer.cs (1)
334 return _toolbarTracker.ToolbarItems.Where(i => i.Order <= ToolbarItemOrder.Primary).OrderBy(i => i.Priority).Select(i => CreateToolbarButton(i));
Microsoft.Maui.Controls.SourceGen (1)
CodeBehindGenerator.cs (1)
515 returnType = $"{returnType}<{string.Join(", ", xmlType.TypeArguments.Select(typeArg => GetTypeName(typeArg, compilation, xmlnsCache, typeCache)))}>";
Microsoft.Maui.Controls.Xaml (3)
CreateValuesVisitor.cs (2)
252 Type[] types = arguments == null ? Array.Empty<Type>() : arguments.Select(a => a.GetType()).ToArray(); 280 throw new MissingMemberException($"No static method found for {nodeType.FullName}::{factoryMethod} ({string.Join(", ", types.Select(t => t.FullName))})");
XamlParser.cs (1)
404 var args = typeArguments.Select(delegate (XmlType xmltype)
Microsoft.Maui.Essentials (9)
Contacts\Contacts.uwp.cs (2)
51 var phones = contact.Phones?.Select( 53 var emails = contact.Emails?.Select(
Email\Email.shared.cs (1)
85 string.Join(",", addresses.Select(Uri.EscapeDataString));
FilePicker\FilePicker.uwp.cs (1)
43 return resultList.Select(storageFile => new FileResult(storageFile));
MediaPicker\MediaPicker.uwp.cs (1)
42 foreach (var filter in defaultTypes.Select(t => t.TrimStart('*')))
Share\Share.shared.cs (1)
358 => files?.Select(file => new ShareFile(file)) ?? Array.Empty<ShareFile>();
TextToSpeech\TextToSpeech.uwp.cs (1)
18 Task.FromResult(SpeechSynthesizer.AllVoices.Select(v => new Locale(v.Language, null, v.DisplayName, v.Id)));
Types\LocationExtensions.uwp.cs (1)
23 mapLocations?.Select(a => a.ToLocation());
Types\PlacemarkExtensions.uwp.cs (1)
11 return mapLocations.Select(address => new Placemark
Microsoft.ML.AutoML (131)
API\AutoCatalog.cs (5)
828var textFeatureColumnNames = textFeatures.Select(c => data.Schema[c.ColumnIndex].Name).ToArray(); 829var numericFeatureColumnNames = numericFeatures.Select(c => data.Schema[c.ColumnIndex].Name).ToArray(); 830var catalogFeatureColumnNames = catalogFeatures.Select(c => data.Schema[c.ColumnIndex].Name).ToArray(); 831var imagePathColumnNames = imagePathFeatures.Select(c => data.Schema[c.ColumnIndex].Name).ToArray(); 832var booleanFeatureColumnNames = booleanFeatures.Select(c => data.Schema[c.ColumnIndex].Name).ToArray();
API\BinaryClassificationExperiment.cs (3)
207var runDetails = monitor.RunDetails.Select(e => BestResultUtil.ToRunDetail(Context, e, _pipeline)); 240var runDetails = monitor.RunDetails.Select(e => BestResultUtil.ToRunDetail(Context, e, _pipeline)); 295var runDetails = monitor.RunDetails.Select(e => BestResultUtil.ToCrossValidationRunDetail(Context, e, _pipeline));
API\MulticlassClassificationExperiment.cs (3)
193var runDetails = monitor.RunDetails.Select(e => BestResultUtil.ToRunDetail(Context, e, _pipeline)); 228var runDetails = monitor.RunDetails.Select(e => BestResultUtil.ToRunDetail(Context, e, _pipeline)); 285var runDetails = monitor.RunDetails.Select(e => BestResultUtil.ToCrossValidationRunDetail(Context, e, _pipeline));
API\RegressionExperiment.cs (3)
181var runDetails = monitor.RunDetails.Select(e => BestResultUtil.ToRunDetail(Context, e, _pipeline)); 222var runDetails = monitor.RunDetails.Select(e => BestResultUtil.ToRunDetail(Context, e, _pipeline)); 278var runDetails = monitor.RunDetails.Select(e => BestResultUtil.ToCrossValidationRunDetail(Context, e, _pipeline));
AutoMLExperiment\AutoMLExperiment.cs (1)
224var mostRecentAddedStopServices = stopServices.GroupBy(s => s.GetType()).Select(g => g.Last()).ToList();
AutoMLExperiment\ITrialResultManager.cs (2)
96}.Concat(Enumerable.Range(0, _searchSpace.FeatureSpaceDim).Select(i => $"parameter_{i}")); 112}.Concat(parameter.Select(p => p.ToString("F3", CultureInfo.InvariantCulture))));
ColumnInference\ColumnGroupingInference.cs (1)
78var ranges = GetRanges(g.Select(t => t.Item1.ColumnIndex).ToArray());
ColumnInference\ColumnInferenceApi.cs (3)
80columnResults = groupingResult.Select(c => c.GenerateTextLoaderColumn()); 81purposeResults = groupingResult.Select(c => (c.SuggestedName, c.Purpose)); 86purposeResults = purposeInferenceResult.Select(p => (dataView.Schema[p.ColumnIndex].Name, p.Purpose));
ColumnInference\ColumnInformationUtil.cs (1)
121return BuildColumnInfo(columns.Select(c => (c.Name, c.Purpose)));
ColumnInference\ColumnTypeInference.cs (3)
317cols[i] = new IntermediateColumn(data.Select(x => x[i]).ToArray(), i); 368var outCols = cols.Select(x => new Column(x.ColumnId, x.Name, x.SuggestedType)).ToArray(); 370return InferenceResult.Success(outCols, args.HasHeader, cols.Select(col => col.RawData).ToArray());
ColumnInference\PurposeInference.cs (1)
279return allColumns.Select(c => c.GetColumn()).ToArray();
ColumnInference\TextFileSample.cs (1)
142.Select(x => AutoMlUtils.Random.Value.NextDouble() * fileSizeRemaining)
Experiment\Runners\CrossValRunner.cs (1)
61var avgScore = CalcAverageScore(trainResults.Select(r => r.Score));
Experiment\Runners\CrossValSummaryRunner.cs (29)
76var bestFoldIndex = BestResultUtil.GetIndexOfBestScore(trainResults.Select(r => r.score), _optimizingMetricInfo.IsMaximizing); 83var avgScore = GetAverageOfNonNaNScores(trainResults.Select(x => x.score)); 84var indexClosestToAvg = GetIndexClosestToAverage(trainResults.Select(r => r.score), avgScore); 86var avgMetrics = GetAverageMetrics(trainResults.Select(x => x.metrics), metricsClosestToAvg); 98var newMetrics = metrics.Select(x => x as BinaryClassificationMetrics); 102auc: GetAverageOfNonNaNScores(newMetrics.Select(x => x.AreaUnderRocCurve)), 103accuracy: GetAverageOfNonNaNScores(newMetrics.Select(x => x.Accuracy)), 104positivePrecision: GetAverageOfNonNaNScores(newMetrics.Select(x => x.PositivePrecision)), 105positiveRecall: GetAverageOfNonNaNScores(newMetrics.Select(x => x.PositiveRecall)), 106negativePrecision: GetAverageOfNonNaNScores(newMetrics.Select(x => x.NegativePrecision)), 107negativeRecall: GetAverageOfNonNaNScores(newMetrics.Select(x => x.NegativeRecall)), 108f1Score: GetAverageOfNonNaNScores(newMetrics.Select(x => x.F1Score)), 109auprc: GetAverageOfNonNaNScores(newMetrics.Select(x => x.AreaUnderPrecisionRecallCurve)), 117var newMetrics = metrics.Select(x => x as MulticlassClassificationMetrics); 121accuracyMicro: GetAverageOfNonNaNScores(newMetrics.Select(x => x.MicroAccuracy)), 122accuracyMacro: GetAverageOfNonNaNScores(newMetrics.Select(x => x.MacroAccuracy)), 123logLoss: GetAverageOfNonNaNScores(newMetrics.Select(x => x.LogLoss)), 124logLossReduction: GetAverageOfNonNaNScores(newMetrics.Select(x => x.LogLossReduction)), 126topKAccuracies: GetAverageOfNonNaNScoresInNestedEnumerable(newMetrics.Select(x => x.TopKAccuracyForAllK)), 134var newMetrics = metrics.Select(x => x as RegressionMetrics); 138l1: GetAverageOfNonNaNScores(newMetrics.Select(x => x.MeanAbsoluteError)), 139l2: GetAverageOfNonNaNScores(newMetrics.Select(x => x.MeanSquaredError)), 140rms: GetAverageOfNonNaNScores(newMetrics.Select(x => x.RootMeanSquaredError)), 141lossFunction: GetAverageOfNonNaNScores(newMetrics.Select(x => x.LossFunction)), 142rSquared: GetAverageOfNonNaNScores(newMetrics.Select(x => x.RSquared))); 148var newMetrics = metrics.Select(x => x as RankingMetrics); 152dcg: GetAverageOfNonNaNScoresInNestedEnumerable(newMetrics.Select(x => x.DiscountedCumulativeGains)), 153ndcg: GetAverageOfNonNaNScoresInNestedEnumerable(newMetrics.Select(x => x.NormalizedDiscountedCumulativeGains))); 178arr[i] = GetAverageOfNonNaNScores(results.Select(x => x.ElementAt(i)));
Experiment\SuggestedPipeline.cs (4)
31Transforms = transforms.Select(t => t.Clone()).ToList(); 32TransformsPostTrainer = transformsPostTrainer.Select(t => t.Clone()).ToList(); 38public override string ToString() => $"{string.Join(" ", Transforms.Select(t => $"xf={t}"))} tr={Trainer} {string.Join(" ", TransformsPostTrainer.Select(t => $"xf={t}"))} cache={(_cacheBeforeTrainer ? "+" : "-")}";
Experiment\SuggestedPipelineRunDetails\SuggestedPipelineCrossValRunDetail.cs (2)
45Exception = Results.Select(r => r.Exception).FirstOrDefault(e => e != null); 52Pipeline.ToPipeline(), Results.Select(r => r.ToTrainResult()));
Experiment\SuggestedTrainer.cs (1)
59paramsStr = string.Join(", ", SweepParams.Where(p => p != null && p.RawValue != null).Select(p => $"{p.Name}:{p.ProcessedValue()}"));
PipelineSuggesters\PipelineSuggester.cs (8)
24var inferredHistory = history.Select(r => SuggestedPipelineRunDetail.FromPipelineRunResult(context, r)); 56var visitedPipelines = new HashSet<SuggestedPipeline>(history.Select(h => h.Pipeline)); 100history = history.GroupBy(r => r.Pipeline.Trainer.TrainerName).Select(g => g.First()); 106var topTrainers = sortedHistory.Take(TopKTrainers).Select(r => r.Pipeline.Trainer); 113var selectedTrainerNames = new HashSet<TrainerName>(selectedTrainers.Select(t => t.TrainerName)); 117.Select(x => x.First().Pipeline.Trainer); 143Values = dp.Options.Select(o => o.ToString()).ToArray() 213var proposedParamSet = sweeper.ProposeSweeps(1, historyToUse.Select(h => h.ToRunResult(isMaximizingMetric))).FirstOrDefault();
SweepableEstimator\MultiModelPipeline.cs (2)
40internal string[] PipelineIds { get => Schema.ToTerms().Select(t => t.ToString()).ToArray(); } 81.Select((se) => _estimators[((StringEntity)se).Value]);
SweepableEstimator\SweepableEstimatorPipeline.cs (1)
91var estimatorName = _estimators.Select(e => e.EstimatorType.ToString());
SweepableEstimator\SweepablePipeline.cs (3)
39var schemaOptions = _schema.ToTerms().Select(t => t.ToString()).ToArray(); 91.Select((se) => 159.Select((se) =>
Sweepers\ISweeper.cs (1)
145return string.Join(" ", _parameterValues.Select(kvp => string.Format("{0}={1}", kvp.Value.Name, kvp.Value.ValueText)).ToArray());
Sweepers\Random.cs (1)
26return new ParameterSet(SweepParameters.Select(sweepParameter => sweepParameter.CreateFromNormalized(AutoMlUtils.Random.Value.NextDouble())));
Sweepers\SmacSweeper.cs (1)
204var retainedConfigs = new HashSet<ParameterSet>(bestConfigurations.Select(x => x.Item2));
Sweepers\SweeperBase.cs (1)
51var prevParamSets = new HashSet<ParameterSet>(previousRuns?.Select(r => r.ParameterSet).ToList() ?? new List<ParameterSet>());
TrainerExtensions\SweepableParams.cs (1)
217return new HashSet<string>(sweepableParams.Select(p => p.Name));
TrainerExtensions\TrainerExtensionUtil.cs (7)
204var paramVals = props.Select(p => new StringParameterValue(p.Key, p.Value.ToString())); 232parameters = allProps.Select(p => new StringParameterValue(p.Key, p.Value.ToString())); 393return binaryTrainers?.Select(t => GetTrainerName(t)); 398return multiTrainers?.Select(t => GetTrainerName(t)); 403return regressionTrainers?.Select(t => GetTrainerName(t)); 408return recommendationTrainers?.Select(t => GetTrainerName(t)); 413return rankingTrainers?.Select(t => GetTrainerName(t));
TransformInference\TransformInference.cs (3)
363var indicatorColNames = GetNewColumnNames(columnsArr.Select(c => $"{c}_MissingIndicator"), columns).ToArray(); 398.Select(c => new IntermediateColumn(c.Name, c.Type, c.Purpose, c.Dimensions)) 479var existingColNames = new HashSet<string>(columns.Select(c => c.ColumnName));
Tuner\AutoZeroTuner.cs (3)
31_pipelineStrings = _sweepablePipeline.Schema.ToTerms().Select(t => new 34pipelineString = string.Join("=>", t.ValueEntities().Select(e => _sweepablePipeline.Estimators[e.ToString()].EstimatorType)), 39var trainerEstimators = _sweepablePipeline.Estimators.Where(e => e.Value.EstimatorType.IsTrainer()).Select(e => e.Value.EstimatorType.ToString()).ToList();
Tuner\EciCfoTuner.cs (1)
31var pipelineSchemas = sweepablePipeline.Schema.ToTerms().Select(t => t.ToString()).ToArray();
Tuner\Flow2.cs (1)
141return move.Select(x =>
Tuner\PipelineProposer.cs (5)
86_pipelineSchemas = _sweepablePipeline.Schema.ToTerms().Select(t => t.ToString()).ToArray(); 102var probabilities = _pipelineSchemas.Select(id => _eci[id]).ToArray(); 110probabilities = probabilities.Select(p => p + double.Epsilon).ToArray(); 188_eci[schema] = _eci.Select(kv => kv.Value).Max() * 2; 201.Select(v =>
Tuner\SmacTuner.cs (9)
128features[i] = _searchSpace.MappingToFeatureSpace(r.TrialSettings.Parameter).Select(f => Convert.ToSingle(f)).ToArray(); 172var bestKParamSets = _histories.OrderBy(i => i.Loss).Take(_localSearchParentCount).Select(r => r.TrialSettings.Parameter); 178var randomChallengers = Enumerable.Range(0, numOfCandidates - eiChallengers.Length).Select(i => _randomTuner.Propose(new TrialSettings())); 206var randomParameters = Enumerable.Range(0, _numRandomEISearchConfigurations).Select(i => _randomTuner.Propose(new TrialSettings())); 207var randomConfigurations = randomParameters.Select(parameter => new Tuple<double, Parameter>(EvaluateConfigurationsByEI(forest, bestLoss, parameter), parameter)); 211var retainedConfigs = new HashSet<Parameter>(orderedConfigurations.Select(x => x.Item2), comparer); 239var eis = neighborhood.Select(p => EvaluateConfigurationsByEI(forest, bestLoss, p)).ToArray(); 264var newFeatures = features.Select(x => x).ToArray(); 322var transformedParams = _searchSpace.MappingToFeatureSpace(parameter).Select(p => Convert.ToSingle(p)).ToArray();
Utils\ArrayMath.cs (12)
15return xArray.Select(x => x + y).ToArray(); 42return xArray.Select(x => Math.Min(Math.Max(x, min), max)).ToArray(); 48return xArray.Select(x => x / y).ToArray(); 54return indices.Select(index => array[index]).ToArray(); 82return xArray.Select(x => x * y).ToArray(); 88return xArray.Select(x => Math.Log(x)).ToArray(); 117return array.Select(v => 1 / v).ToArray(); 123return array.Select(v => v / sum).ToArray(); 133var diff = Enumerable.Range(0, truth.Length).Select(i => truth[i] - pred[i]).ToArray(); 134var sqaure = diff.Select(x => x * x); 148var diff = Enumerable.Range(0, truth.Length).Select(i => truth[i] - pred[i]).ToArray(); 162var diff = Enumerable.Range(0, truth.Length).Select(i => Math.Abs(truth[i] - pred[i])).ToArray();
Utils\BestResultUtil.cs (3)
51var scores = results.Select(r => metricsAgent.GetScore(r.ValidationMetrics)); 64var scores = results.Select(r => r.Results.Average(x => metricsAgent.GetScore(x.ValidationMetrics))); 116var crossValidationResult = result.CrossValidationMetrics.Select(m => new TrainResult<TMetrics>(new ModelContainer(context, m.Model), m.Metrics, result.Exception));
Utils\SplitUtil.cs (3)
16var originalColumnNames = trainData.Schema.Select(c => c.Name); 52var originalColumnNames = trainData.Schema.Select(c => c.Name); 61var allColumns = data.Schema.Select(c => c.Name);
Utils\SweepableParamAttributes.cs (1)
115return $"[{GetType().Name}({name}new object[]{{{string.Join(", ", Options.Select(TranslateOption))}}})]";
Microsoft.ML.AutoML.Interactive (2)
AutoMLMonitorKernelExtension.cs (2)
74var x = monitor.CompletedTrials.Select(x => x.TrialSettings.TrialId); 75var y = monitor.CompletedTrials.Select(x => x.Metric);
Microsoft.ML.AutoML.Samples (3)
AutoMLExperiment.cs (1)
101.Select(x => x ? randomFloat() : randomFloat() +
Cifar10.cs (1)
20.Select(p => new ModelInput
Sweepable\SweepableLightGBMBinaryExperiment.cs (1)
128.Select(x => x ? randomFloat() : randomFloat() +
Microsoft.ML.AutoML.SourceGenerator (14)
EstimatorTypeGenerator.cs (2)
37.SelectMany(union => union.EstimatorTypes.Select(t => Utils.CreateEstimatorName(union.FunctionName, t))) 42.SelectMany(union => union.EstimatorTypes.Select(t => Utils.CreateEstimatorName(union.FunctionName, t)))
SearchSpaceGenerator.cs (5)
33.Select(f => f.GetText().ToString()) 35var searchSpacesJNodes = searchSpacesJson.Select(x => JsonNode.Parse(x)); 41var options = searchSpaceJArray.Select(t => 115var values = searchSpaceNode.AsArray().Select(x => x.Deserialize<string>()); 120"string" => $"new object[]{{ {string.Join(",", values.Select(x => $"\"{x}\""))} }}",
SweepableEstimatorFactoryGenerator.cs (2)
34.SelectMany(union => union.EstimatorTypes.Select(t => (Utils.CreateEstimatorName(union.FunctionName, t), Utils.ToTitleCase(union.SearchOption)))) 39.SelectMany(union => union.EstimatorTypes.Select(t => (Utils.CreateEstimatorName(union.FunctionName, t), Utils.ToTitleCase(union.SearchOption))))
SweepableEstimatorGenerator.cs (2)
35var code = estimators.SelectMany(e => e.EstimatorTypes.Select(eType => (e, eType, Utils.CreateEstimatorName(e.FunctionName, eType))) 36.Select(x =>
Template\SweepableEstimator.cs (1)
59this.Write(this.ToStringHelper.ToStringWithCulture(Utils.PrettyPrintListOfString(UsingStatements.Select(x => $"using {x};"))));
Template\SweepableEstimator_T_.cs (1)
63this.Write(this.ToStringHelper.ToStringWithCulture(Utils.PrettyPrintListOfString(UsingStatements.Select(x => $"using {x};"))));
Utils.cs (1)
72return string.Join(string.Empty, str.Split('_', ' ', '-').Select(x => CapitalFirstLetter(x)));
Microsoft.ML.AutoML.Tests (14)
AutoFitTests.cs (6)
140Assert.True(result.BestRun.Results.Select(x => x.ValidationMetrics.Accuracy).Min() > 0.70); 205Assert.True(result.BestRun.Results.Select(x => x.ValidationMetrics.RSquared).Min() > 0.70); 337var originalColumnNames = trainData.Schema.Select(c => c.Name); 364var originalColumnNames = trainData.Schema.Select(c => c.Name); 373result.BestRun.Results.Select(x => x.ValidationMetrics.MicroAccuracy).Max().Should().BeGreaterThan(0.1); 660if (experiment.RunDetails.Select(r => r.Exception == null).Count() > 1 && experiment.RunDetails.Last().Exception != null)
SweepableExtensionTest.cs (3)
149.Append(context.Auto().MultiClassification().Estimators.Select(kv => kv.Value).ToArray()); 162.Append(context.Auto().MultiClassification().Estimators.Select(kv => kv.Value).ToArray()); 175.Append(context.Auto().MultiClassification().Estimators.Select(kv => kv.Value).ToArray());
TunerTests.cs (1)
212var randomLosses = Enumerable.Range(0, 100).Select(i => i * 0.1);
Utils\MLNetUtils\DataViewTestFixture.cs (1)
20return BuildDummyDataView(schema.Select(c => (c.Name, c.Type)), createDummyRow);
Utils\TaskAgnosticAutoFit.cs (3)
70var iterationResults = classificationResult.RunDetails.Select(i => new TaskAgnosticIterationResult(i)).ToList(); 92iterationResults = regressionResult.RunDetails.Select(i => new TaskAgnosticIterationResult(i)).ToList(); 114iterationResults = recommendationResult.RunDetails.Select(i => new TaskAgnosticIterationResult(i)).ToList();
Microsoft.ML.Benchmarks.Tests (2)
BenchmarksTest.cs (2)
63string.Join(", ", summary.Reports.Where(r => !r.BuildResult.IsBuildSuccess).Select(r => r.BenchmarkCase.DisplayInfo))); 67string.Join(", ", summary.Reports.Where(r => r.ExecuteResults == null).Select(r => r.BenchmarkCase.DisplayInfo)));
Microsoft.ML.CodeGenerator (8)
CodeGenerator\CSharp\CodeGenerator.cs (2)
221var preTrainerTransforms = preTrainerTransformsAndUsings?.Select(t => t.Item1).ToList(); 222var postTrainerTransforms = postTrainerTransformsAndUsings?.Select(t => t.Item1).ToList();
CodeGenerator\CSharp\CSharpSolution.cs (1)
29Utilities.Utils.AddProjectsToSolution(solutionPath, this.Select((project) => project.Name).ToArray());
CodeGenerator\CSharp\PipelineExtension.cs (2)
39var preTrainerTransforms = preTrainerTransformsAndUsings?.Select(t => t.Item1).ToList(); 40var postTrainerTransforms = postTrainerTransformsAndUsings?.Select(t => t.Item1).ToList();
Utils.cs (3)
28return string.Join("", name.Select(x => Char.IsLetterOrDigit(x) ? x : '_')); 63List<string> normalizedColumnNames = GenerateColumnNames(featureColumns.Select(column => column.Name).ToList()); 196var projectPaths = projects.Select((name) => $"\"{Path.Combine(Path.GetDirectoryName(solutionPath), name).ToString()}\"");
Microsoft.ML.Core (19)
CommandLine\ArgumentAttribute.cs (1)
95return _shortName.Split(',').Select(name => name.Trim()).ToArray();
CommandLine\CmdParser.cs (1)
1543settings = values.Select(x => (string)x.Value).ToArray();
ComponentModel\ComponentCatalog.cs (3)
752return _signatures.Select(kvp => kvp.Key).ToArray(); 784.Where(ci => ci.LoadNames.Select(n => n.ToLowerInvariant().Trim()).Contains(name)) 909return _components.Select(x => x.Kind).Distinct().OrderBy(x => x);
EntryPoints\ModuleArgs.cs (2)
60Aliases = parts.Select(x => x.Trim()).ToArray(); 395return $"[TlcModule.{GetType().Name}({name}new object[]{{{string.Join(", ", Options.Select(TranslateOption))}}})]";
SearchSpace\ChoiceAttribute.cs (2)
22var candidatesType = candidates.Select(o => o.GetType()).Distinct(); 33var candidatesType = candidates.Select(o => o.GetType()).Distinct();
Utilities\LruCache.cs (1)
25public IEnumerable<TKey> Keys => _lru.Select(kvp => kvp.Key);
Utilities\MatrixTransposeOps.cs (9)
91IEnumerable<int> jenum = Enumerable.Range(0, jsteps).Select(j => j * _block); 92IEnumerable<int> ienum = Enumerable.Range(0, isteps).Select(i => i * _block); 93IEnumerable<Tuple<int, int>> ijenum = ienum.SelectMany(i => jenum.Select(j => new Tuple<int, int>(i, j))); 143IEnumerable<int> jenum = Enumerable.Range(0, jsteps).Select(j => j * _block); 144IEnumerable<int> ienum = Enumerable.Range(0, isteps).Select(i => i * _block); 145IEnumerable<Tuple<int, int>> ijenum = ienum.SelectMany(i => jenum.Select(j => new Tuple<int, int>(i, j))); 196IEnumerable<int> jenum = Enumerable.Range(0, jsteps).Select(j => j * _block); 197IEnumerable<int> ienum = Enumerable.Range(0, isteps).Select(i => i * _block); 198IEnumerable<Tuple<int, int>> ijenum = ienum.SelectMany(i => jenum.Select(j => new Tuple<int, int>(i, j)));
Microsoft.ML.Core.Tests (26)
UnitTests\TestUtilities.cs (8)
54List<float> x = Enumerable.Range(0, 1000000).Select(i => (float)i).ToList(); 88double[] x = Enumerable.Range(0, 1000000).Select(i => (double)i).ToArray(); 236float[] x = Enumerable.Range(0, 10).Select(i => (float)i).ToArray(); 237float[] y = Enumerable.Range(0, 10).Select(i => (float)i).ToArray(); 259float[] xOfDifferentLength = Enumerable.Range(0, 9).Select(i => (float)i).ToArray(); 272double[] x = Enumerable.Range(0, 10).Select(i => (double)i).ToArray(); 273double[] y = Enumerable.Range(0, 10).Select(i => (double)i).ToArray(); 295double[] xOfDifferentLength = Enumerable.Range(0, 9).Select(i => (double)i).ToArray();
UnitTests\TestVBuffer.cs (18)
140var values = Enumerable.Range(0, length).Select(x => x + 0.1f).ToArray(); 144float[] a2Values = aDense.Select(x => x + 1).ToArray(); 163var values = Enumerable.Range(0, length).Select(x => x + 0.1f).ToArray(); 167float[] a2Values = aDense.Select(x => x + 1).ToArray(); 184float[] a2Values = aDense.Select(x => x + 1).ToArray(); 227float[] a2Values = aDense.Select(x => x).ToArray(); 284float[] values = Enumerable.Range(startRange, 10).Select(i => (float)i).ToArray(); 308float[] values = Enumerable.Range(1, 10).Select(i => (float)i).ToArray(); 326var aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 327int[] indices = aIndices.Union(b.Items().Select(iv => iv.Key)).OrderBy(i => i).ToArray(); 372int[] indices = a.Items().Select(iv => iv.Key).Union(b.Items().Select(iv => iv.Key)).OrderBy(i => i).ToArray(); 417var aIndices = a.Items().Select(iv => iv.Key); 418var bIndices = b.Items().Select(iv => iv.Key); 503int[] indices = a.Items().Select(iv => iv.Key) 504.Union(b.Items().Select(iv => iv.Key)).Distinct().OrderBy(x => x).ToArray(); 799HashSet<int> aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 800HashSet<int> bIndices = new HashSet<int>(b.Items().Select(iv => iv.Key));
Microsoft.ML.Data (139)
Commands\CrossValidationCommand.cs (4)
216if (!TryGetOverallMetrics(tasks.Select(t => t.Result.Metrics).ToArray(), out var overallList)) 221eval.PrintAdditionalMetrics(ch, tasks.Select(t => t.Result.Metrics).ToArray()); 222Dictionary<string, IDataView>[] metricValues = tasks.Select(t => t.Result.Metrics).ToArray(); 229ImplOptions.OutputExampleFoldIndex, tasks.Select(t => t.Result.PerInstanceResults).ToArray(), out var variableSizeVectorColumnNames);
Commands\TypeInfoCommand.cs (2)
126string srcStrings = string.Join(", ", srcs.OrderBy(k => k).Select(k => '`' + k.GetString() + '`')); 127string dstStrings = string.Join(", ", dsts.OrderBy(k => k).Select(k => '`' + k.GetString() + '`'));
Data\DataViewUtils.cs (1)
1402.Select(
DataDebuggerPreview.cs (1)
62ColumnView = Enumerable.Range(0, n).Select(c => new ColumnInfo(data.Schema[c], columns[c].ToArray())).ToImmutableArray();
DataLoadSave\Binary\BinaryLoader.cs (5)
991.Select(x => new { col = x, isSavable = saver.IsColumnSavable(schema[x].Type) }); 992int[] toSave = cols.Where(x => x.isSavable).Select(x => x.col).ToArray(); 993unsavableColIndices = cols.Where(x => !x.isSavable).Select(x => x.col).ToArray(); 2164var cols = loader._aliveColumns.Select(t => new KeyValuePair<bool, TableOfContentsEntry>(true, t)) 2165.Concat(loader._deadColumns.Select(t => new KeyValuePair<bool, TableOfContentsEntry>(false, t)))
DataLoadSave\Binary\BinarySaver.cs (2)
584HashSet<int> activeSet = new HashSet<int>(activeColumns.Select(col => col.SourceIndex)); 739HashSet<int> active = new HashSet<int>(actives.Select(cc => cc.SourceIndex));
DataLoadSave\Database\DatabaseLoader.cs (2)
138column.Source = indexMappingAttr.Sources.Select((source) => Range.FromTextLoaderRange(source)).ToArray(); 142column.Source = nameMappingAttr.Sources.Select((source) => new Range(source)).ToArray();
DataLoadSave\LegacyCompositeDataLoader.cs (1)
141.Select(x => new KeyValuePair<string, string>(x.Key, GetTagData(x.Value)))
DataLoadSave\TransformerChain.cs (1)
115_scopes = transformers.Select(x => TransformerScope.Everything).ToArray();
DataView\CompositeRowToRowMapper.cs (1)
58var activeIndices = activeColumns.Select(c => c.Index).ToArray();
DataView\RowToRowMapperTransform.cs (1)
260Host.Assert(column.Index < activeArr.Length, $"The columns {activeColumns.Select(c => c.Name)} are not suitable for the OutputSchema.");
DataView\TypedCursor.cs (1)
216.Select(rc => (RowCursor<TRow>)(new RowCursorImplementation(new TypedCursor(this, rc))))
DataView\ZipDataView.cs (1)
52_zipBinding = new ZipBinding(_sources.Select(x => x.Schema).ToArray());
EntryPoints\EntryPointNode.cs (5)
27serializer.Serialize(writer, variable.Values.Select(v => $"${v}")); 111_values = variables.Select(v => v.VarName).ToArray(); 344.Select(x => x.Name) 789return _inputMap.Where(kv => !_inputBuilder.IsInputOptional(kv.Key.ParameterName)).Select(kv => kv.Value).Distinct() 918ch.Warning("Node '{0}' has unexpected fields that are ignored: {1}", id, string.Join(", ", unexpectedFields.Select(x => x.Name)));
EntryPoints\PredictorModelImpl.cs (1)
132return keyValues.DenseValues().Select(v => v.ToString()).ToArray();
Evaluators\AnomalyDetectionEvaluator.cs (2)
171topKStratCol.AddRange(agg.Scores.Select(x => stratColKey)); 172topKStratVal.AddRange(agg.Scores.Select(x => stratColVal));
Evaluators\BinaryClassifierEvaluator.cs (2)
294prStratCol.AddRange(agg.Scores.Select(x => stratColKey)); 295prStratVal.AddRange(agg.Scores.Select(x => stratColVal));
Evaluators\EvaluatorBase.cs (3)
80var stratIndices = Utils.Size(stratCols) > 0 ? new HashSet<int>(stratCols.Select(col => col.Index)) : new HashSet<int>(); 311warnings.Select(s => s.AsMemory()).ToArray()); 441return _dict.Select(kvp => kvp.Value);
Evaluators\EvaluatorUtils.cs (10)
494var reconciledSlotNames = new VBuffer<ReadOnlyMemory<char>>(slotNames.Count, slotNames.Keys.Select(k => k.AsMemory()).ToArray()); 613var keyValueMappers = Utils.MarshalInvoke(MapKeys<int>, keyValueType.RawType, views.Select(view => view.Schema).ToArray(), columnName, false, indices, keyNames); 681var keyValueMappers = Utils.MarshalInvoke(MapKeys<int>, keyValueType.RawType, views.Select(view => view.Schema).ToArray(), columnName, true, columnIndices, keyNames); 942return AppendRowsDataView.Create(env, null, views.Select(keyToValue).Select(selectDropNonVarLenthCol).ToArray()); 1705sb.Append(GetOverallMetricsAsString(weightedAgg.Select(x => x.Sum).ToArray(), weightedAgg.Select(x => x.SumSq).ToArray(), numFolds, true, true, weightedAgg.Select(x => x.Name).ToList())); 1706sb.Append(GetOverallMetricsAsString(agg.Select(x => x.Sum).ToArray(), agg.Select(x => x.SumSq).ToArray(), numFolds, false, true, agg.Select(x => x.Name).ToList()));
Evaluators\MulticlassClassificationEvaluator.cs (5)
115names = Enumerable.Range(0, numClasses).Select(i => i.ToString().AsMemory()).ToArray(); 182confStratCol.AddRange(agg.UnweightedCounters.ConfusionTable.Select(x => stratColKey)); 183confStratVal.AddRange(agg.UnweightedCounters.ConfusionTable.Select(x => stratColVal)); 226dst = new VBuffer<ReadOnlyMemory<char>>(allTopK.First().Length, Enumerable.Range(1, allTopK.First().Length).Select(i => new ReadOnlyMemory<char>(i.ToString().ToCharArray())).ToArray()); 312public double[] AllTopKAccuracy => CumulativeSum(_seenRanks.Take(OutputTopKAcc ?? 0).Select(l => l / _numInstances)).ToArray();
Evaluators\RankingEvaluator.cs (3)
192groupStratCol.AddRange(agg.UnweightedCounters.GroupDcg.Select(x => stratColKey)); 193groupStratVal.AddRange(agg.UnweightedCounters.GroupDcg.Select(x => stratColVal)); 194groupName.AddRange(agg.GroupId.Select(sb => sb.ToString().AsMemory()));
Model\Pfa\PfaContext.cs (2)
168_variables.UnionWith(locals.Select(v => v.Key)); 178_variables.UnionWith(locals.Select(v => v.Key));
Scorers\FeatureContributionCalculation.cs (1)
371if (activeColumns.Select(c => c.Index).Contains(_outputGenericSchema.Count))
Scorers\RowToRowScorerBase.cs (2)
171var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index)); 441foreach (var pair in Mapper.OutputSchema[iinfo - DerivedColumnCount].Annotations.Schema.Select(c => new KeyValuePair<string, DataViewType>(c.Name, c.Type)))
Scorers\SchemaBindablePredictorWrapper.cs (1)
241if (activeColumns.Select(c => c.Index).Contains(0))
TrainCatalog.cs (6)
255return result.Select(x => new CrossValidationResult<BinaryClassificationMetrics>(x.Model, 280return result.Select(x => new CrossValidationResult<CalibratedBinaryClassificationMetrics>(x.Model, 478return result.Select(x => new CrossValidationResult<ClusteringMetrics>(x.Model, 559return result.Select(x => new CrossValidationResult<MulticlassClassificationMetrics>(x.Model, 629return result.Select(x => new CrossValidationResult<RegressionMetrics>(x.Model, 720return result.Select(x => new CrossValidationResult<RankingMetrics>(x.Model,
Transforms\ColumnBindingsBase.cs (2)
516return Input[index].Annotations.Schema.Select(c => new KeyValuePair<string, DataViewType>(c.Name, c.Type)); 720var schemaColumns = indices.Select(idx => idx >= 0 ? new DataViewSchema.DetachedColumn(input[idx]) : addedColumns[~idx]);
Transforms\ColumnConcatenatingTransformer.cs (12)
89taggedColumn.Source = res.Source.Select(s => new KeyValuePair<string, string>(null, s)).ToArray(); 100column.Source = Source.Select(kvp => kvp.Value).ToArray(); 151return inputColumnNames.Select(name => (name, (string)null)); 224=> _columns.Select(col => (outputColumnName: col.Name, inputColumnNames: col.Sources.Select(source => source.name).ToArray())).ToArray().AsReadOnly(); 380.Select(c => new ColumnOptions(c.Name, c.Source)) 400.Select(c => new ColumnOptions(c.Name, c.Source.Select(kvp => (kvp.Value, kvp.Key != "" ? kvp.Key : null)))) 553_srcTypes = sources.Select(c => inputSchema[c].Type).ToArray(); 871protected override DataViewSchema.DetachedColumn[] GetOutputColumnsCore() => _columns.Select(x => x.MakeSchemaColumn()).ToArray(); 940var node = ctx.CreateNode(opType, inputList.Select(t => t.Key), 942node.AddAttribute("inputdimensions", inputList.Select(x => x.Value));
Transforms\ColumnCopying.cs (1)
152var transformer = new ColumnCopyingTransformer(env, options.Columns.Select(x => (x.Name, x.Source)).ToArray());
Transforms\ColumnSelecting.cs (5)
135if (!Transformer.IgnoreMissing && !ColumnSelectingTransformer.IsSchemaValid(inputSchema.Select(x => x.Name), 475if (!IgnoreMissing && !IsSchemaValid(inputSchema.Select(x => x.Name), 494if (!IgnoreMissing && !IsSchemaValid(inputSchema.Select(x => x.Name), 512if (!IgnoreMissing && !IsSchemaValid(input.Schema.Select(x => x.Name), 618var outputColumns = map.Select(x => new DataViewSchema.DetachedColumn(inputSchema[x]));
Transforms\ConversionsExtensionsCatalog.cs (14)
106var columnOptions = columns.Select(x => new TypeConvertingEstimator.ColumnOptions(x.OutputColumnName, outputKind, x.InputColumnName)).ToArray(); 163return new KeyToValueMappingEstimator(env, columns.Select(x => (x.OutputColumnName, x.InputColumnName)).ToArray()); 217var columnOptions = columns.Select(x => new KeyToVectorMappingEstimator.ColumnOptions(x.OutputColumnName, x.InputColumnName, outputCountVector)).ToArray(); 291var columnOptions = columns.Select(x => new ValueToKeyMappingEstimator.ColumnOptions(x.OutputColumnName, x.InputColumnName, maximumNumberOfKeys, keyOrdinality, addKeyValueAnnotationsAsText)).ToArray(); 339var keys = keyValuePairs.Select(pair => pair.Key); 340var values = keyValuePairs.Select(pair => pair.Value); 371var keys = keyValuePairs.Select(pair => pair.Key); 372var values = keyValuePairs.Select(pair => pair.Value); 405var keys = keyValuePairs.Select(pair => pair.Key); 406var values = keyValuePairs.Select(pair => pair.Value); 443var keys = keyValuePairs.Select(pair => pair.Key); 444var values = keyValuePairs.Select(pair => pair.Value); 475var keys = keyValuePairs.Select(pair => pair.Key); 476var values = keyValuePairs.Select(pair => pair.Value);
Transforms\ExtensionsCatalog.cs (2)
45infos.Select(info => (info.OutputColumnName, info.InputColumnName)).ToArray(); 49infos.Select(info => new InputOutputColumnPair(info.outputColumnName, info.inputColumnName)).ToList().AsReadOnly();
Transforms\Hashing.cs (1)
158return columns.Select(x => (x.Name, x.InputColumnName)).ToArray();
Transforms\KeyToValue.cs (1)
109var transformer = new KeyToValueMappingTransformer(env, options.Columns.Select(c => (c.Name, c.Source ?? c.Name)).ToArray());
Transforms\KeyToVector.cs (2)
104return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 724node.AddAttribute("cats_int64s", Enumerable.Range(1, categoryRange).Select(x => (long)x));
Transforms\MetadataDispatcher.cs (1)
236foreach (var kvp in info.SchemaSrc[info.IndexSrc].Annotations.Schema.Select(c => new KeyValuePair<string, DataViewType>(c.Name, c.Type)))
Transforms\NormalizeColumn.cs (5)
314.Select(col => new NormalizingEstimator.MinMaxColumnOptions( 332.Select(col => new NormalizingEstimator.MeanVarianceColumnOptions( 352.Select(col => new NormalizingEstimator.LogMeanVarianceColumnOptions( 372.Select(col => new NormalizingEstimator.BinningColumnOptions( 393.Select(col => new NormalizingEstimator.RobustScalingColumnOptions(
Transforms\NormalizeColumnDbl.cs (1)
1377=> new NormalizingTransformer.BinNormalizerModelParameters<ImmutableArray<TFloat>>(_binUpperBounds.Select(b => ImmutableArray.Create(b)).ToImmutableArray(),
Transforms\NormalizeColumnSng.cs (1)
1540_binUpperBounds.Select(b => ImmutableArray.Create(b)).ToImmutableArray(),
Transforms\Normalizer.cs (2)
314_columns = columns.Select(x => ColumnOptionsBase.Create(x.outputColumnName, x.inputColumnName, mode)).ToArray(); 525: base(env.Register(nameof(NormalizingTransformer)), columns.Select(x => (x.Name, x.InputColumnName)).ToArray())
Transforms\SlotsDroppingTransformer.cs (3)
229Slots = column.Slots.Select(range => (range.Min, range.Max)).ToArray(); 316var columns = options.Columns.Select(column => new ColumnOptions(column)).ToArray(); 418=> columns.Select(c => (c.Name, c.InputColumnName ?? c.Name)).ToArray();
Transforms\TransformBase.cs (2)
551.Select(x => new ColumnTmp 820var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
Transforms\TypeConverting.cs (1)
181return columns.Select(x => (x.Name, x.InputColumnName)).ToArray();
Transforms\ValueMapping.cs (13)
229builder.AddColumn(columnName, values.Select(x => x.ToString()).ToArray()); 244var converted = value.Select(x => x.ToString().AsMemory()); 306uint[] indices = values.Select((x) => Convert.ToUInt32(x)).ToArray(); 311ulong[] indices = values.Select((x) => Convert.ToUInt64(x)).ToArray(); 688(string outputColumnName, string inputColumnName)[] columns = options.Columns.Select(x => (x.Name, x.Source)).ToArray(); 1004view = ColumnSelectingTransformer.CreateKeep(host, view, cols.Select(x => x.outputColumnName).ToArray()); 1220node.AddAttribute("values_int64s", _valueMap.GetValues<int>().Select(item => Convert.ToInt64(item))); 1226node.AddAttribute("values_int64s", _valueMap.GetValues<short>().Select(item => Convert.ToInt64(item))); 1232node.AddAttribute("values_int64s", _valueMap.GetValues<ulong>().Select(item => Convert.ToInt64(item))); 1238node.AddAttribute("values_int64s", _valueMap.GetValues<uint>().Select(item => Convert.ToInt64(item))); 1244node.AddAttribute("values_int64s", _valueMap.GetValues<ushort>().Select(item => Convert.ToInt64(item))); 1254node.AddAttribute("values_floats", _valueMap.GetValues<double>().Select(item => Convert.ToSingle(item))); 1264node.AddAttribute("values_floats", _valueMap.GetValues<bool>().Select(item => Convert.ToSingle(item)));
Transforms\ValueToKeyMappingTransformer.cs (3)
215return columns.Select(x => (x.OutputColumnName, x.InputColumnName)).ToArray(); 797node.AddAttribute("keys_strings", terms.Select(item => item.ToString())); 810node.AddAttribute("keys_floats", terms.Select(item => Convert.ToSingle(item)));
Utilities\SlotDropper.cs (1)
228return slots.Except(droppedSlots).Select(i => (long)i);
Microsoft.ML.DataView (4)
DataViewSchema.cs (3)
122null : $" {{{string.Join(", ", Annotations.Schema.Select(x => x.Name))}}}"; 245public override string ToString() => string.Join(", ", Schema.Select(x => x.Name)); 358return new Annotations(builder.ToSchema(), _items.Select(x => x.Getter).ToArray());
SchemaDebuggerProxy.cs (1)
22Columns = Enumerable.Range(0, schema.Count).Select(x => schema[x]).ToArray();
Microsoft.ML.Ensemble (7)
Trainer\Binary\EnsembleTrainer.cs (2)
100models.Select(k => new FeatureSubsetModel<float>((TDistPredictor)k)).ToArray(), combiner); 105models.Select(k => new FeatureSubsetModel<float>((TScalarPredictor)k)).ToArray(), combiner);
Trainer\EnsembleDistributionModelParameters.cs (1)
241averagedWeights = Models.SelectMany(model => model.Metrics).Where(m => m.Key == metric.Key).Select(m => (Single)m.Value).ToArray();
Trainer\EnsembleTrainerBase.cs (2)
215ch.Info("{0}| Name of Model |", string.Join("", models[0].Metrics.Select(m => string.Format("| {0} |", m.Key)))); 218ch.Info("{0}{1}", string.Join("", model.Metrics.Select(m => string.Format("| {0} |", m.Value))), model.Predictor.GetType().Name);
Trainer\Multiclass\MulticlassDataPartitionEnsembleTrainer.cs (1)
102models.Select(k => new FeatureSubsetModel<VBuffer<float>>((TVectorPredictor)k)).ToArray(),
Trainer\Regression\RegressionEnsembleTrainer.cs (1)
92models.Select(k => new FeatureSubsetModel<float>((TScalarPredictor)k)).ToArray(), combiner);
Microsoft.ML.EntryPoints (3)
JsonUtils\JsonManifestUtils.cs (2)
276return new JArray(inputs.OrderBy(x => x.Key).Select(x => x.Value).ToArray()); 304return new JArray(outputs.OrderBy(x => x.Key).Select(x => x.Value).ToArray());
ScoreColumnSelector.cs (1)
105var dropColumn = ColumnSelectingTransformer.CreateDrop(env, copyColumn, copyCols.Select(c => c.source).ToArray());
Microsoft.ML.Fairlearn (22)
Metrics\FairlearnMetricCatalog.cs (17)
94.ToDictionary(group => group.Key, group => _context.Data.LoadFromEnumerable(group.Select(g => g.Item2))); 96var groupMetric = res.Select(kv => (kv.Key, _context.BinaryClassification.EvaluateNonCalibrated(kv.Value))) 100result[_sensitiveFeatureColumn] = DataFrameColumn.Create(_sensitiveFeatureColumn, groupMetric.Keys.Select(x => x.ToString())); 101result["AUC"] = DataFrameColumn.Create("AUC", groupMetric.Keys.Select(k => groupMetric[k].AreaUnderRocCurve)); //coloumn name? 102result["Accuracy"] = DataFrameColumn.Create("Accuracy", groupMetric.Keys.Select(k => groupMetric[k].Accuracy)); 103result["PosPrec"] = DataFrameColumn.Create("PosPrec", groupMetric.Keys.Select(k => groupMetric[k].PositivePrecision)); 104result["PosRecall"] = DataFrameColumn.Create("PosRecall", groupMetric.Keys.Select(k => groupMetric[k].PositiveRecall)); 105result["NegPrec"] = DataFrameColumn.Create("NegPrec", groupMetric.Keys.Select(k => groupMetric[k].NegativePrecision)); 106result["NegRecall"] = DataFrameColumn.Create("NegRecall", groupMetric.Keys.Select(k => groupMetric[k].NegativeRecall)); 107result["F1Score"] = DataFrameColumn.Create("F1Score", groupMetric.Keys.Select(k => groupMetric[k].F1Score)); 108result["AreaUnderPrecisionRecallCurve"] = DataFrameColumn.Create("AreaUnderPrecisionRecallCurve", groupMetric.Keys.Select(k => groupMetric[k].AreaUnderPrecisionRecallCurve)); 190var data = new DataFrame(_eval.Schema.AsEnumerable().Select<DataViewSchema.Column, DataFrameColumn>(column => 234result[_sensitiveFeatureColumn] = DataFrameColumn.Create(_sensitiveFeatureColumn, groupMetric.Keys.Select(x => x.ToString())); 235result["RSquared"] = DataFrameColumn.Create("RSquared", groupMetric.Keys.Select(k => groupMetric[k].RSquared)); 236result["RMS"] = DataFrameColumn.Create("RMS", groupMetric.Keys.Select(k => groupMetric[k].RootMeanSquaredError)); 237result["MSE"] = DataFrameColumn.Create("MSE", groupMetric.Keys.Select(k => groupMetric[k].MeanSquaredError)); 238result["MAE"] = DataFrameColumn.Create("MAE", groupMetric.Keys.Select(k => groupMetric[k].MeanAbsoluteError));
Reductions\GridSearchTrialRunner.cs (5)
60var lambdasValue = key.Select(x => 73df["sign"] = DataFrameColumn.Create("sign", lambdasValue.Select(x => x.sign)); 74df["group_id"] = DataFrameColumn.Create("group_id", lambdasValue.Select(x => x.e)); 75df["value"] = DataFrameColumn.Create("value", lambdasValue.Select(x => x.value)); 83var predictedLabel = eval.GetColumn<bool>("PredictedLabel").Select(b => b ? 1f : 0f).ToArray();
Microsoft.ML.FastTree (76)
Dataset\Dataset.cs (24)
160_maxDocsPerQuery = Enumerable.Range(0, NumQueries).Select(NumDocsInQuery).Max(); 273Dataset[] datasets = Enumerable.Range(0, numParts).Select(p => datasetSkeletonPart[p] == null ? 294int[] queryIndices = docIndices.Select(d => DocToQuery[d]).ToArray(); 295ulong[] uniqueQueryIds = queryIndices.Distinct().Select(q => QueryIds[q]).ToArray(); 309DatasetSkeleton datasetSkeleton = new DatasetSkeleton(docIndices.Select(d => Ratings[d]).ToArray(), 312docIndices.Select(d => DocIds[d]).ToArray()); 333filteredDupeIds = docIndices.Select(i => dupeIds[i]).ToArray(); 589int[] numQueries = fraction.Select(x => (int)(x * NumQueries)).ToArray(numParts); 594queries = numQueries.Select(q => new int[q]).ToArray(numParts); 621List<int>[] listQueries = Enumerable.Range(0, numParts).Select(x => new List<int>()).ToArray(numParts); 630queries = listQueries.Select(x => x.ToArray()).ToArray(numParts); 634assignment = Enumerable.Range(0, numParts).Select( 647int[][] boundaries = queries.Select(q => new int[q.Length + 1]).ToArray(numParts); 663ratings[p] = assignment[p].Select(d => Ratings[d]).ToArray(); 664queryIds[p] = queries[p].Select(q => QueryIds[q]).ToArray(); 665docIds[p] = assignment[p].Select(d => DocIds[d]).ToArray(); 669DatasetSkeleton[] datasetSkeleton = Enumerable.Range(0, numParts).Select( 748double[][] maxAtN = Enumerable.Range(0, trunc).Select(x => new double[boundaries.Length - 1]).ToArray(trunc); 815int[] docLengths = parts.Select(x => x.NumDocs).ToArray(); 816int[] queryLengths = parts.Select(x => x.NumQueries).ToArray(); 828Array concatArray = ConcatArrays(partsDatas.Select(pd => pd.Data).ToArray(), isQuery ? queryLengths : docLengths, name); 845IEnumerable<string> typeNameEnumerable = arrays.Select(x => x.GetType().GetElementType()).Distinct().Select(x => x.Name).OrderBy(n => n); 963_flockIndexers = _dataset._flocks.Select(d => d.GetFlockIndexer()).ToArray(_dataset.NumFlocks);
Dataset\DatasetUtils.cs (3)
36ratings.Length, IntArrayType.Dense, IntArrayBits.Bits8, ratings.Select(x => (int)x)); 37uint[] valueMap = Enumerable.Range(0, ((int)maxLab) + 1).Select(x => (uint)x + 5).ToArray(); 49foreach (uint uintQid in skel.QueryIds.Select(qid => (uint)qid).Distinct().OrderBy(x => x))
Dataset\DenseIntArray.cs (4)
58return IntArray.New(itemIndices.Length, IntArrayType.Dense, BitsPerItem, itemIndices.Select(x => this[x])); 68newArrays[p] = IntArray.New(assignment[p].Length, IntArrayType.Dense, BitsPerItem, assignment[p].Select(x => this[x])); 405_data = values.Select(i => (byte)i).ToArray(len); 605_data = values.Select(i => (ushort)i).ToArray(len);
Dataset\Feature.cs (2)
275.Select(bins => new TsvFeature(bins, _valueMap, _name)).ToArray(); 306uint[] concatValueMap = Algorithms.MergeSortedUniqued(parts.Select(x => x.ValueMap).ToArray());
Dataset\OneHotFeatureFlock.cs (1)
25.Select(bins => new OneHotFeatureFlock(bins, HotFeatureStarts, AllBinUpperBounds, false))
Dataset\RepeatIntArray.cs (3)
188return new DeltaRepeatIntArray(itemIndices.Length, BitsPerItem, itemIndices.Select(i => indexer[i])); 198return assignment.Select(a => 201return new DeltaRepeatIntArray(a.Length, BitsPerItem, a.Select(i => indexer[i]));
Dataset\SegmentIntArray.cs (3)
305return assignment.Select(a => 308return new SegmentIntArray(a.Length, a.Select(i => ind[i])); 321return new SegmentIntArray(itemIndices.Length, itemIndices.Select(i => indexer[i]));
Dataset\SingletonFeatureFlock.cs (1)
63.Select(bins => new SingletonFeatureFlock(bins, _binUpperBounds)).ToArray();
Dataset\SparseIntArray.cs (2)
206parts[i] = IntArray.New(assignment[i].Length, IntArrayType.Sparse, BitsPerItem, assignment[i].Select(x => indexer[x])); 221return IntArray.New(itemIndices.Length, IntArrayType.Sparse, BitsPerItem, itemIndices.Select(x => indexer[x]));
FastTree.cs (10)
1103var bups = features.Select(fi => BinUpperBounds[fi]).ToArray(features.Count); 1177var bups = features.Select(fi => BinUpperBounds[fi]).ToArray(features.Count); 1630ulong[] dids = Enumerable.Range(0, numExamples).Select(d => (ulong)d).ToArray(numExamples); 2033var bups = features.Select(fi => BinUpperBounds[fi]).ToArray(features.Count); 3257return TrainedEnsemble.Trees.Select(k => new Tree(k)).ToArray(); 3315_regTree.CategoricalSplitFeatures[nodeId].Select(feature => features[feature])); 3386var trees = TrainedEnsemble.Trees.Select(tree => new RegressionTree(tree)); 3387var treeWeights = TrainedEnsemble.Trees.Select(tree => tree.Weight); 3432var trees = TrainedEnsemble.Trees.Select(tree => new QuantileRegressionTree((InternalQuantileRegressionTree)tree)); 3433var treeWeights = TrainedEnsemble.Trees.Select(tree => tree.Weight);
FastTreeClassification.cs (1)
248return set.Ratings.Select(x => x >= 1);
FastTreeRegression.cs (1)
179return dlabels.Select(x => (float)x).ToArray(dlabels.Length);
GamModelParameters.cs (1)
494thresholds: internalNodeIndices.Select(x => (float)binThresholds[binIndices[x]]).ToArray(),
RandomForestClassification.cs (1)
357_trainSetLabels = TrainSet.Ratings.Select(x => x >= 1).ToArray(TrainSet.NumDocs);
SumupPerformanceCommand.cs (1)
273arrays.Select(bins => new FeatureHistogram(bins, _bins, false)).ToArray(arrays.Length);
Training\DocumentPartitioning.cs (3)
85.Select(x => new List<int>(innerLoopSize / tree.NumLeaves)) 101.Select(leaf => Enumerable.Range(0, perChunkDocumentLists.Length) 102.Select(thread => perChunkDocumentLists[thread][leaf].Count)
Training\RegressionTreeNodeDocuments.cs (1)
56return Tree.GetNodesLeaves(NodeIndex).Select(l => new RegressionTreeNodeDocuments(Tree, Partitioning, ~l));
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (3)
265bestLeaf = BestSplitInfoPerLeaf.Select(info => info.Gain).ArgMax(tree.NumLeaves); 456bestFeature = leafSplitCandidates.FeatureSplitInfo.Select(info => info.Gain) 486bestFeature = leafSplitCandidates.FeatureSplitInfo.Select(info => info.Gain / SoftmaxTemperature).SoftArgMax(Rand);
TreeEnsemble\InternalRegressionTree.cs (3)
108CategoricalSplit = categoricalSplitAsBytes.Select(b => b > 0).ToArray(); 514(CategoricalSplitFeatures != null ? CategoricalSplitFeatures.Select(thresholds => thresholds.SizeInBytes()).Sum() : 0) + 515(CategoricalSplitFeatureRanges != null ? CategoricalSplitFeatureRanges.Select(ranges => ranges.SizeInBytes()).Sum() : 0) +
TreeEnsembleFeaturizer.cs (1)
188var activeIndices = activeColumns.Select(c => c.Index);
Utils\MappedObjectPool.cs (2)
29_map = Enumerable.Range(0, maxIndex).Select(x => -1).ToArray(maxIndex); 30_inverseMap = Enumerable.Range(0, _pool.Length).Select(x => -1).ToArray(_pool.Length);
Utils\PseudorandomFunction.cs (2)
22_data = _periodics.Select(x => Enumerable.Range(0, x).Select(y => rand.Next(-1, int.MaxValue) + 1).ToArray()).ToArray();
Utils\RegressionTreeBaseUtils.cs (2)
26var numberOfRows = trees.Select(tree => tree.NumberOfNodes).Sum() + trees.Select(tree => tree.NumberOfLeaves).Sum();
Utils\ThreadTaskManager.cs (1)
83.Select<int, Action>(arg => (() => subTaskAction(arg)));
Microsoft.ML.GenAI.Core (5)
Trainer\CasualLMSupervisedFineTuningTrainer.cs (3)
54var inputIds = torch.cat(batch.Select(x => nn.functional.pad(x.InputIds, [0, maxLen - x.InputIds.shape[1]])).ToArray(), 0).to(device); 55var attentionMask = torch.cat(batch.Select(x => nn.functional.pad(x.AttentionMask!, [0, maxLen - x.AttentionMask!.shape[1]])).ToArray(), 0).to(device); 56var labels = torch.cat(batch.Select(x => nn.functional.pad(x.Labels!, [0, maxLen - x.Labels!.shape[1]], value: -100)).ToArray(), 0).to(device);
Trainer\CausalLMDataset.cs (2)
67return Create(enumerable.Select(x => x.inputIds), enumerable.Select(x => x.outputIds));
Microsoft.ML.GenAI.LLaMA (1)
LlamaChatCompletionService.cs (1)
38return replies.Select(reply => new ChatMessageContent(AuthorRole.Assistant, reply.Text)).ToList();
Microsoft.ML.GenAI.LLaMA.Tests (1)
LLaMA3_1Tests.cs (1)
86var tokenizedStr = string.Join(", ", tokenizeIds.Select(x => x.ToString()));
Microsoft.ML.GenAI.Mistral (5)
Mistral_7B_0_3ChatTemplateBuilder.cs (3)
67var schemas = tools.Select(t => new 121var toolCallObjects = toolCalls.Select(tc => 144var toolCallResultObjects = toolCallResults.Select(tc =>
MistralCausalLMAgent.cs (2)
151.Select(tc => new ToolCall(tc.Name!, JsonSerializer.Serialize(tc.Arguments)) { ToolCallId = this.GenerateToolCallId() }); 164.Select(s => s[random.Next(s.Length)]).ToArray());
Microsoft.ML.GenAI.Mistral.Tests (1)
Mistral_7B_Instruct_V0_3Tests.cs (1)
131var tokenizedStr = string.Join(", ", tokenizeIds.Select(x => x.ToString()));
Microsoft.ML.GenAI.Phi (4)
Module\Phi2Model.cs (1)
44this.layers = new ModuleList<Phi2DecoderLayer>(Enumerable.Range(0, config.NumHiddenLayers).Select(i => new Phi2DecoderLayer(config)).ToArray());
Module\Phi3SuScaledRotaryEmbedding.cs (2)
30this._shortFactor = shortFactorElement.EnumerateArray().Select(e => e.GetDouble()).ToArray(); 31this._longFactor = longFactorDocument.EnumerateArray().Select(e => e.GetDouble()).ToArray();
Phi3\Phi3CausalLMChatCompletionService.cs (1)
40return replies.Select(reply => new ChatMessageContent(AuthorRole.Assistant, reply.Text)).ToList();
Microsoft.ML.GenAI.Phi.Tests (2)
Phi2Tests.cs (1)
57var tokenizedStr = string.Join(", ", tokenized.Select(x => x.ToString()));
Phi3Tests.cs (1)
145var tokenizedStr = string.Join(", ", tokenizeIds.Select(x => x.ToString()));
Microsoft.ML.GenAI.Samples (3)
Llama\SFT_Llama_3_2_1B.cs (3)
103var chatHistory = dataset.Select(data => 116return CausalLMDataset.Create(chatHistory.Select(c => c.trainChatHistory), chatHistory.Select(c => c.assistantMessage), templateBuilder, tokenizer);
Microsoft.ML.ImageAnalytics (5)
ImagePixelExtractor.cs (1)
190return columns.Select(x => (x.Name, x.InputColumnName)).ToArray();
ImageResizer.cs (2)
147return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 270=> _parent._columns.Select(x => new DataViewSchema.DetachedColumn(x.Name, x.Type, null)).ToArray();
VectorToImageTransform.cs (2)
294return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 425return columns.Select(c => new ImageDataViewType(c.ImageHeight, c.ImageWidth)).ToArray();
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (1)
74.Select(p => p.Parent).Where(n => n.IsKind(SyntaxKind.IdentifierName));
SingleVariableDeclarationAnalyzer.cs (1)
46string jointVariableNames = string.Join("', '", vars.Select(v => v.Identifier.Text));
Microsoft.ML.KMeansClustering (1)
KMeansPlusPlusTrainer.cs (1)
1840Contracts.Check(centroid.Items().Select(x => x.Value).All(FloatUtils.IsFinite), "Model training failed: non-finite coordinates are generated");
Microsoft.ML.LightGbm (6)
LightGbmTrainerBase.cs (2)
429var catBoundaries = !String.IsNullOrEmpty(modelParameters["categorical_feature"]) ? modelParameters["categorical_feature"].Split(',').Select(x => int.Parse(x, CultureInfo.InvariantCulture)).ToArray() : null; 606catMetaData.CatIndices = catIndices.Select(int.Parse).ToArray();
WrappedLightGbmBooster.cs (4)
122return str.Split(delimiter).Select(x => int.Parse(x, CultureInfo.InvariantCulture)).ToArray(); 127return str.Split(delimiter).Select(x => UInt32.Parse(x, CultureInfo.InvariantCulture)).ToArray(); 292threshold.Select(x => (float)(x)).ToArray(), defaultValue.Select(x => (float)(x)).ToArray(), leftChild, rightChild, leafOutput,
Microsoft.ML.Mkl.Components (2)
VectorWhitening.cs (2)
195var infos = options.Columns.Select(colPair => new VectorWhiteningEstimator.ColumnOptions(colPair, options)).ToArray(); 209=> columns.Select(c => (c.Name, c.InputColumnName ?? c.Name)).ToArray();
Microsoft.ML.OnnxConverter (8)
OnnxContextImpl.cs (1)
350_initializers.Add(OnnxUtils.MakeInt32s(name, typeof(bool), values.Select(v => Convert.ToInt32(v)), dims));
OnnxUtils.cs (5)
95attribute.Floats.Add(value.Select(x => (float)x)); 105attribute.Floats.Add(value.Select(x => x)); 191=> node.Attribute.Add(MakeAttribute(argName, value.Select(v => v ? (long)1 : 0))); 264=> str.Select(s => ByteString.CopyFrom(Encoding.UTF8.GetBytes(s.ToString()))); 267=> str.Select(s => ByteString.CopyFrom(Encoding.UTF8.GetBytes(s)));
SaveOnnxCommand.cs (2)
226IEnumerable<string> slotNamesAsStrings = slotNames.DenseValues().Select(name => name.ToString()); 240node.AddAttribute("values_int64s", Enumerable.Range(0, slotNames.Length).Select(x => (long)x));
Microsoft.ML.OnnxTransformer (11)
OnnxTransform.cs (6)
321CustomShapeInfos = shapeDictionary?.Select(pair => new CustomShapeInfo(pair.Key, pair.Value)).ToArray(), 347CustomShapeInfos = shapeDictionary?.Select(pair => new CustomShapeInfo(pair.Key, pair.Value)).ToArray(), 377CustomShapeInfos = shapeDictionary?.Select(pair => new CustomShapeInfo(pair.Key, pair.Value)).ToArray(), 409CustomShapeInfos = shapeDictionary?.Select(pair => new CustomShapeInfo(pair.Key, pair.Value)).ToArray(), 463return shape.Select(x => (x <= 0) ? 0 : x); 761var trueValue = namedOnnxValue.AsEnumerable<NamedOnnxValue>().Select(value => value.AsDictionary<string, float>());
OnnxTypeParser.cs (1)
276return o.Select(v => (TDst)caster(v)).ToList();
OnnxUtils.cs (4)
62InputNames = inputsInfo.Select(val => val.Name).ToList(); 64OutputNames = outputsInfo.Select(val => val.Name).ToList(); 66InitializerNames = initializersInfo.Select(val => val.Name).ToList(); 559var dimensions = shape.Select(x => (int)x).ToArray();
Microsoft.ML.Parquet (3)
ParquetLoader.cs (2)
319builder.AddColumns(cols.Select(c => new DataViewSchema.DetachedColumn(c.Name, c.ColType, null))); 464Columns = _loader._columnsLoaded.Select(i => i.Name).ToArray()
PartitionedFileLoader.cs (1)
206_srcDirIndex = columns.Select(c => c.Source).ToArray();
Microsoft.ML.PCA (2)
PcaTransformer.cs (2)
297return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 404bool[] center = Enumerable.Range(0, mean.Length).Select(i => mean[i] != null).ToArray();
Microsoft.ML.PerformanceTests (1)
HashBench.cs (1)
199var tokens = "Hello my friend, stay awhile and listen! ".Split().Select(token => token.AsMemory()).ToArray();
Microsoft.ML.ResultProcessor (1)
ResultProcessor.cs (1)
1158+ string.Join(cmd.PerFoldResultSeparator, new List<string>(new List<float>(kvp.Value.AllValues).Select(d => "" + d))));
Microsoft.ML.Samples (110)
Dynamic\TensorFlow\ImageClassification.cs (2)
101var image1 = Enumerable.Range(0, inputSize).Select( 104var image2 = Enumerable.Range(0, inputSize).Select(
Dynamic\Trainers\BinaryClassification\AveragedPerceptron.cs (1)
100.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\AveragedPerceptronWithOptions.cs (1)
111.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\FactorizationMachine.cs (1)
108.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\FastForest.cs (1)
103.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\FastForestWithOptions.cs (1)
115.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\FastTree.cs (1)
106.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\FastTreeWithOptions.cs (1)
118.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\LbfgsLogisticRegression.cs (1)
103.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\LbfgsLogisticRegressionWithOptions.cs (1)
112.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\LdSvm.cs (1)
100.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\LdSvmWithOptions.cs (1)
109.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\LightGbm.cs (1)
103.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\LightGbmWithOptions.cs (1)
114.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\LinearSvm.cs (1)
100.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\LinearSvmWithOptions.cs (1)
109.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportance.cs (1)
54.Select(feature => feature.index);
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportanceLoadFromDisk.cs (1)
53.Select(feature => feature.index);
Dynamic\Trainers\BinaryClassification\PriorTrainer.cs (1)
100.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SdcaLogisticRegression.cs (1)
108.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SdcaLogisticRegressionWithOptions.cs (1)
120.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SdcaNonCalibrated.cs (1)
107.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SdcaNonCalibratedWithOptions.cs (1)
122.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SgdCalibrated.cs (1)
100.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SgdCalibratedWithOptions.cs (1)
112.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SgdNonCalibrated.cs (1)
100.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SgdNonCalibratedWithOptions.cs (1)
109.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SymbolicSgdLogisticRegression.cs (1)
103.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\BinaryClassification\SymbolicSgdLogisticRegressionWithOptions.cs (1)
112.Select(x => x ? randomFloat() : randomFloat() +
Dynamic\Trainers\Clustering\KMeans.cs (1)
107.Select(index => label == 0 ? randomFloat() + 0.1f :
Dynamic\Trainers\Clustering\KMeansWithOptions.cs (1)
115.Select(index => label == 0 ? randomFloat() + 0.1f :
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropy.cs (1)
105.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropyWithOptions.cs (1)
113.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\LightGbm.cs (1)
108.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\LightGbmWithOptions.cs (1)
118.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\LogLossPerClass.cs (1)
88.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\NaiveBayes.cs (1)
113.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\OneVersusAll.cs (1)
106.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\PairwiseCoupling.cs (1)
106.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportance.cs (1)
56.Select(feature => feature.index);
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportanceLoadFromDisk.cs (1)
64.Select(feature => feature.index);
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropy.cs (1)
112.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropyWithOptions.cs (1)
122.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibrated.cs (1)
113.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibratedWithOptions.cs (1)
122.Select(x => randomFloat() + label * 0.2f).ToArray()
Dynamic\Trainers\Ranking\FastTree.cs (1)
86Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Ranking\FastTreeWithOptions.cs (1)
100Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Ranking\LightGbm.cs (1)
86Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Ranking\LightGbmWithOptions.cs (1)
101Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Ranking\PermutationFeatureImportance.cs (1)
59.Select(feature => feature.index);
Dynamic\Trainers\Ranking\PermutationFeatureImportanceLoadFromDisk.cs (1)
66.Select(feature => feature.index);
Dynamic\Trainers\Regression\FastForest.cs (1)
83Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\FastForestWithOptions.cs (1)
96Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\FastTree.cs (1)
83Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\FastTreeTweedie.cs (1)
83Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\FastTreeTweedieWithOptions.cs (1)
98Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\FastTreeWithOptions.cs (1)
99Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\Gam.cs (1)
83Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\GamWithOptions.cs (1)
94Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\LbfgsPoissonRegression.cs (1)
81Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\LbfgsPoissonRegressionWithOptions.cs (1)
95Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\LightGbm.cs (1)
84Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\LightGbmAdvanced.cs (1)
36.Select(column => column.Name) // Get the column names
Dynamic\Trainers\Regression\LightGbmWithOptions.cs (1)
103Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\LightGbmWithOptionsAdvanced.cs (1)
37.Select(column => column.Name) // Get the column names
Dynamic\Trainers\Regression\OnlineGradientDescent.cs (1)
72Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\OnlineGradientDescentWithOptions.cs (1)
88Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\OrdinaryLeastSquares.cs (1)
80Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\OrdinaryLeastSquaresWithOptions.cs (1)
92Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\PermutationFeatureImportance.cs (1)
61.Select(feature => feature.index);
Dynamic\Trainers\Regression\PermutationFeatureImportanceLoadFromDisk.cs (1)
68.Select(feature => feature.index);
Dynamic\Trainers\Regression\Sdca.cs (1)
80Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Trainers\Regression\SdcaWithOptions.cs (1)
96Features = Enumerable.Repeat(label, 50).Select(
Dynamic\Transforms\ApplyOnnxModel.cs (2)
73var image1 = Enumerable.Range(0, inputSize).Select(x => (float)x / 76var image2 = Enumerable.Range(0, inputSize).Select(x => (float)(x +
Dynamic\Transforms\ApproximatedKernelMap.cs (1)
43Console.WriteLine(string.Join(", ", row.Select(x => x.ToString(
Dynamic\Transforms\Conversion\MapKeyToVector.cs (3)
64string.Join(',', featureRow.TimeframeVector.Select(x => x)) + " " 65+ string.Join(',', featureRow.PartsCount.Select(x => x)) + 66" " + string.Join(',', featureRow.PartsNoCount.Select(
Dynamic\Transforms\ImageAnalytics\ConvertToImage.cs (1)
103inputSize).Select(x => (float)random.Next(0, 256)).ToArray()
Dynamic\Transforms\NormalizeBinning.cs (2)
51Console.WriteLine(string.Join(", ", row.Select(x => x.ToString( 63Console.WriteLine(string.Join(", ", row.Select(x => x.ToString(
Dynamic\Transforms\NormalizeBinningMulticolumn.cs (1)
52Console.WriteLine(string.Join(", ", column[i].Select(x => x
Dynamic\Transforms\NormalizeGlobalContrast.cs (1)
38Console.WriteLine(string.Join(", ", row.Select(x => x.ToString(
Dynamic\Transforms\NormalizeLogMeanVariance.cs (2)
49Console.WriteLine(string.Join(", ", row.Select(x => x.ToString( 59Console.WriteLine(string.Join(", ", row.Select(x => x.ToString(
Dynamic\Transforms\NormalizeLogMeanVarianceFixZero.cs (2)
42Console.WriteLine(string.Join(", ", row.Select(x => x.ToString("f4")))); 51Console.WriteLine(string.Join(", ", row.Select(x => x.ToString("f4"))));
Dynamic\Transforms\NormalizeLpNorm.cs (1)
39Console.WriteLine(string.Join(", ", row.Select(x => x.ToString(
Dynamic\Transforms\NormalizeMeanVariance.cs (2)
48Console.WriteLine(string.Join(", ", row.Select(x => x.ToString( 59Console.WriteLine(string.Join(", ", row.Select(x => x.ToString(
Dynamic\Transforms\NormalizeMinMax.cs (2)
47Console.WriteLine(string.Join(", ", row.Select(x => x.ToString( 59Console.WriteLine(string.Join(", ", row.Select(x => x.ToString(
Dynamic\Transforms\NormalizeMinMaxMulticolumn.cs (4)
73Console.WriteLine(string.Join(", ", column[i].Select(x => x 75string.Join(", ", column2[i].Select(x => x.ToString("f4")))); 90Console.WriteLine(string.Join(", ", columnFixZero[i].Select(x => x 92string.Join(", ", column2FixZero[i].Select(x => x.ToString("f4"))));
Dynamic\Transforms\NormalizeSupervisedBinning.cs (2)
65Console.WriteLine(string.Join(", ", row.Select(x => x.ToString( 78Console.WriteLine(string.Join(", ", row.Select(x => x.ToString(
Dynamic\Transforms\Projection\VectorWhiten.cs (1)
43Console.WriteLine(string.Join(" ", row.DenseValues().Select(x =>
Dynamic\Transforms\Projection\VectorWhitenWithOptions.cs (1)
42Console.WriteLine(string.Join(" ", row.DenseValues().Select(x =>
Dynamic\Transforms\TimeSeries\DetectSeasonality.cs (1)
18var seasonalData = Enumerable.Range(0, 100).Select(x => new TimeSeriesData(Math.Sin(2 * Math.PI + x)));
Dynamic\Transforms\TreeFeaturization\FastForestBinaryFeaturizationWithOptions.cs (1)
136Features = Enumerable.Repeat(label, 3).Select(x => x ?
Dynamic\Transforms\TreeFeaturization\FastForestRegressionFeaturizationWithOptions.cs (1)
134Features = Enumerable.Repeat(label, 3).Select(x => x +
Dynamic\Transforms\TreeFeaturization\FastTreeBinaryFeaturizationWithOptions.cs (1)
138Features = Enumerable.Repeat(label, 3).Select(x => x ?
Dynamic\Transforms\TreeFeaturization\FastTreeRankingFeaturizationWithOptions.cs (1)
135Features = Enumerable.Repeat(label, 3).Select(x => randomFloat()
Dynamic\Transforms\TreeFeaturization\FastTreeRegressionFeaturizationWithOptions.cs (1)
134Features = Enumerable.Repeat(label, 3).Select(x => x +
Dynamic\Transforms\TreeFeaturization\FastTreeTweedieFeaturizationWithOptions.cs (1)
134Features = Enumerable.Repeat(label, 3).Select(x => x +
Dynamic\Transforms\TreeFeaturization\PretrainedTreeEnsembleFeaturizationWithOptions.cs (1)
145Features = Enumerable.Repeat(label, 3).Select(x => x ?
Microsoft.ML.Samples.GPU (2)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\ImageClassification.cs (2)
101var image1 = Enumerable.Range(0, inputSize).Select( 104var image2 = Enumerable.Range(0, inputSize).Select(
Microsoft.ML.SearchSpace (8)
Option\ChoiceOption.cs (1)
32Choices = distinctChoices.Select(o => Parameter.FromObject(o)).ToArray();
Option\NestOption.cs (1)
24public override int FeatureSpaceDim => _options.Values.Select(x => x.FeatureSpaceDim).Sum();
SearchSpace.cs (2)
78return _options.Values.Select(x => x.FeatureSpaceDim).Sum(); 304Contract.Assert(supportTypes.Contains(type) || type.IsEnum, $"[Option:{optionName}] ChoiceAttribute can only apply to enum or the following types {string.Join(",", supportTypes.Select(x => x.Name))}");
Tuner\GridSearchTuner.cs (3)
23var steps = _searchSpace.Step.Select(x => x ?? _stepSize) 24.Select(x => Enumerable.Range(0, x).Select(i => i * 1.0 / x).ToArray());
Tuner\RandomTuner.cs (1)
34var featureVec = Enumerable.Repeat(0, d).Select(i => _rnd.NextDouble()).ToArray();
Microsoft.ML.SearchSpace.Tests (18)
UniformNumericOptionTests.cs (18)
25var sampleInputs = Enumerable.Range(0, 10).Select(i => i * 0.1); 26var sampleOutputs = sampleInputs.Select(i => option.SampleFromFeatureSpace(new[] { i })); 28sampleOutputs.Select(x => x.AsType<int>()).Should().Equal(0, 10, 20, 30, 40, 50, 60, 70, 80, 90); 36var sampleInputs = Enumerable.Range(0, 10).Select(i => i * 0.1); 37var sampleOutputs = sampleInputs.Select(i => option.SampleFromFeatureSpace(new[] { i })); 39sampleOutputs.Select(x => x.AsType<int>()).Should().Equal(1, 2, 4, 8, 16, 32, 64, 128, 256, 512); 47var sampleInputs = Enumerable.Range(0, 10).Select(i => Parameter.FromInt(i * 10)); 48var sampleOutputs = sampleInputs.Select(i => option.MappingToFeatureSpace(i)[0]); 65var sampleInputs = Enumerable.Range(0, 10).Select(i => Parameter.FromInt(Convert.ToInt32(Math.Pow(2, i)))); 66var sampleOutputs = sampleInputs.Select(i => option.MappingToFeatureSpace(i)[0]).ToArray(); 79var sampleInputs = Enumerable.Range(0, 10).Select(i => i * 0.1); 80var sampleOutputs = sampleInputs.Select(i => option.SampleFromFeatureSpace(new[] { i })); 92var sampleInputs = Enumerable.Range(0, 10).Select(i => i * 0.1); 93var sampleOutputs = sampleInputs.Select(i => option.SampleFromFeatureSpace(new[] { i })); 105var sampleInputs = Enumerable.Range(0, 10).Select(i => Parameter.FromDouble(i * 10.0)); 106var sampleOutputs = sampleInputs.Select(i => option.MappingToFeatureSpace(i)[0]); 116var sampleInputs = Enumerable.Range(0, 10).Select(i => Parameter.FromDouble(Math.Pow(2, i))); 117var sampleOutputs = sampleInputs.Select(i => option.MappingToFeatureSpace(i)).ToArray();
Microsoft.ML.StandardTrainers (6)
FactorizationMachine\FactorizationMachineTrainer.cs (1)
611return new FieldAwareFactorizationMachinePredictionTransformer(_host, model, trainData.Schema, FeatureColumns.Select(x => x.Name).ToArray());
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (1)
108var activeIndices = activeColumns.Select(c => c.Index).ToArray();
Standard\LinearModelParameters.cs (1)
88return _pred.Weight.Items(all: true).Select(iv => iv.Value).GetEnumerator();
Standard\LogisticRegression\MulticlassLogisticRegression.cs (3)
956predictor["coeff"] = new JArray(Weights.Select(w => new JArray(w.DenseValues()))); 996node.AddAttribute("classlabels_ints", Enumerable.Range(1, NumberOfClasses).Select(x => (long)x)); 1105bldr.AddColumn("ClassNames", Enumerable.Range(0, NumberOfClasses).Select(i => GetLabelName(i)).ToArray());
Microsoft.ML.Sweeper (13)
Algorithms\Grid.cs (4)
53SweepParameters = options.SweptParameters.Select(p => p.CreateComponent(Host)).ToArray(); 70var prevParamSets = previousRuns?.Select(r => r.ParameterSet).ToList() ?? new List<ParameterSet>(); 161? previousRuns.Select(r => r.ParameterSet).ToList() 184return new ParameterSet(SweepParameters.Select(sweepParameter => sweepParameter[Host.Rand.Next(sweepParameter.Count)]));
Algorithms\KdoSweeper.cs (1)
101_sweepParameters = options.SweptParameters.Select(p => p.CreateComponent(_host)).ToArray();
Algorithms\NelderMead.cs (4)
176return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); 226return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); 260return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); 279return _pendingSweeps.Select(kvp => kvp.Key).ToArray();
Algorithms\Random.cs (1)
34return new ParameterSet(SweepParameters.Select(sweepParameter => sweepParameter.CreateFromNormalized(Host.Rand.NextDouble())));
Algorithms\SmacSweeper.cs (1)
83_sweepParameters = options.SweptParameters.Select(p => p.CreateComponent(_host)).ToArray();
ConfigRunner.cs (1)
167ch.Info("Parameter set: {0}", string.Join(", ", sweeps[i].Select(p => string.Format("{0}:{1}", p.Name, p.ValueText))));
ISweeper.cs (1)
174return string.Join(" ", _parameterValues.Select(kvp => string.Format("{0}={1}", kvp.Value.Name, kvp.Value.ValueText)).ToArray());
Microsoft.ML.Sweeper.Tests (1)
TestSweeper.cs (1)
476var nextList = sweeper.ProposeSweeps(5, initialList.Select(p => new RunResult(p)));
Microsoft.ML.TensorFlow (6)
TensorflowTransform.cs (2)
378return new TensorShape(dims.Select(x => (int)x).ToArray()); 892_dims = _tfShape.dims.Select(x => (long)x).ToArray();
TensorflowUtils.cs (4)
446var dims = tfShape.dims.Select(x => (long)x).ToArray(); 545_inputs = inputs?.Select(x => ParseOutput(session, x)).ToArray() ?? new TF_Output[0]; 546_outputs = outputs?.Select(x => ParseOutput(session, x)).ToArray() ?? new TF_Output[0]; 547_operations = operations?.Select(x => c_api.TF_GraphOperationByName(session.graph, x)).ToArray() ?? new IntPtr[0];
Microsoft.ML.Tests (103)
CachingTests.cs (4)
43var trainData = Enumerable.Range(0, 100).Select(c => new MyData()).ToArray(); 53trainData = Enumerable.Range(0, 100).Select(c => new MyData()).ToArray(); 83var src = Enumerable.Range(0, 100).Select(c => new MyData()).ToArray(); 89src = Enumerable.Range(0, 100).Select(c => new MyData()).ToArray();
ImagesTests.cs (1)
1109Features = Enumerable.Repeat(0, InputSize).Select(x => random.NextDouble() * 100).ToArray()
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (2)
489.Select(x => new CustomerChurnInfo 668var microAccuracies = cvResults.Select(r => r.Metrics.MicroAccuracy);
Scenarios\Api\TestApi.cs (5)
358return view.GetColumn<ReadOnlyMemory<char>>(view.Schema["Workclass"]).Select(x => x.ToString()).ToList(); 381var uniqueTrain = stratTrainWorkclass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList(); 383var uniqueTest = stratTestWorkClass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList(); 393var uniqueSeedTrain = stratTrainWithSeedWorkclass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList(); 395var uniqueSeedTest = stratTestWithSeedWorkClass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList();
TrainerEstimators\TreeEstimators.cs (1)
734.Select(x => randomFloat() + label * 0.2f).ToArray()
Transformers\CategoricalHashTests.cs (22)
143Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 146Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "0:A", "1:B" }); 149Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 152Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[1] { "C" }); 156Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 159Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[6] { "1:2", "0:5", "1:4", "1:6", "0:3", "0:1" }); 162Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 165Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "-1", "1" }); 169Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 172System.Diagnostics.Trace.WriteLine(slots.Items().Select(x => x.Value.ToString()).Distinct()); 173var temp = slots.Items().Select(x => x.Value.ToString()).Distinct(); 174Assert.Equal(slots.Items().Select(x => x.Value.ToString()).Distinct(), new string[14] { "[0].", "[0].0:A", "[0].0:E", "[0].0:D", "[0].1:A", "[0].1:E", "[0].1:D", "[1].", "[1].0:A", "[1].0:E", "[1].0:D", "[1].1:A", "[1].1:E", "[1].1:D" }); 177Assert.Equal(slotRanges.Items().Select(x => x.Value.ToString()), new string[4] { "0", "65535", "65536", "131071" }); 181Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 184Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "E", "D" }); 187Assert.Equal(slotRanges.Items().Select(x => x.Value.ToString()), new string[2] { "0", "65535" }); 191Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues }); 194Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "0:A", "1:B" }); 197Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues }); 200Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[1] { "C" }); 203Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 208Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized });
Transformers\CategoricalTests.cs (26)
221Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 224Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "A", "B" }); 227Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 230Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[1] { "C" }); 234Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 237Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "3", "5" }); 240Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 243Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "6", "1" }); 247Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 250Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[12] { "[0].1", "[0].2", "[0].3", "[0].4", "[0].5", "[0].6", "[1].1", "[1].2", "[1].3", "[1].4", "[1].5", "[1].6" }); 253Assert.Equal(slotRanges.Items().Select(x => x.Value.ToString()), new string[4] { "0", "5", "6", "11" }); 257Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 260Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "1", "-1" }); 263Assert.Equal(slotRanges.Items().Select(x => x.Value.ToString()), new string[2] { "0", "1" }); 267Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues }); 270Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[3] { "A", "D", "E" }); 273Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues }); 276Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "D", "E" }); 279Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 282Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[6] { "[0].Bit2", "[0].Bit1", "[0].Bit0", "[1].Bit2", "[1].Bit1", "[1].Bit0" }); 285Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 288Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "Bit1", "Bit0" }); 292Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 295Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[6] { "[0].Bit2", "[0].Bit1", "[0].Bit0", "[1].Bit2", "[1].Bit1", "[1].Bit0" }); 298Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 301Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[3] { "Bit2", "Bit1", "Bit0" });
Transformers\ConvertTests.cs (4)
352Assert.Equal(result.Schema["ConvA"].Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 356Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "1", "2" }); 359Assert.Equal(result.Schema["ConvB"].Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues }); 362Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "A", "B" });
Transformers\HashTests.cs (4)
89Assert.Equal(keys.Items().Select(x => x.Value.ToString()), new string[2] { "2.5", "3.5" }); 94Assert.Equal(keys.Items().Select(x => x.Value.ToString()), new string[2] { "2.5", "3.5" }); 99Assert.Equal(keys.Items().Select(x => x.Value.ToString()), new string[2] { "0:3.5", "1:2.5" }); 397var dHashed = transformed.GetColumn<VBuffer<uint>>(transformed.Schema["DHashed"]).Select(buffer =>
Transformers\KeyToBinaryVectorEstimatorTest.cs (4)
117Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 120Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[6] { "[0].Bit2", "[0].Bit1", "[0].Bit0", "[1].Bit2", "[1].Bit1", "[1].Bit0" }); 123Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 126Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "Bit1", "Bit0" });
Transformers\KeyToVectorEstimatorTests.cs (18)
136Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 139Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "A", "B" }); 142Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 145Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[1] { "C" }); 148Assert.Equal(slotRanges.Items().Select(x => x.Value), new int[2] { 0, 0 }); 152Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 155Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[4] { "[0].3", "[0].5", "[1].3", "[1].5" }); 158Assert.Equal(slotRanges.Items().Select(x => x.Value), new int[4] { 0, 1, 2, 3 }); 162Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 165Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "6", "1" }); 169Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 172Assert.Equal(slotRanges.Items().Select(x => x.Value), new int[4] { 0, 5, 6, 11 }); 176Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.IsNormalized }); 180Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 183Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[3] { "A", "D", "E" }); 186Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 189Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "D", "E" }); 192Assert.Equal(slotRanges.Items().Select(x => x.Value), new int[2] { 0, 1 });
Transformers\LineParserTests.cs (1)
65var result = LineParser.ParseKeyThenNumbers("word" + separator[sep % 2] + string.Join(separator[sep / 2], data.Select(x => x.ToString("G9"))), false);
Transformers\NormalizerTests.cs (2)
1036var tensor1 = Enumerable.Range(0, Size).Select( 1039var tensor2 = Enumerable.Range(0, Size).Select(
Transformers\RffTests.cs (4)
47new TestClass() { A = Enumerable.Range(0, 100).Select(x => (float)rand.NextDouble()).ToArray() }, 48new TestClass() { A = Enumerable.Range(0, 100).Select(x => (float)rand.NextDouble()).ToArray() } 95new TestClass() { A = Enumerable.Range(0, 100).Select(x => (float)rand.NextDouble()).ToArray() }, 96new TestClass() { A = Enumerable.Range(0, 100).Select(x => (float)rand.NextDouble()).ToArray() }
Transformers\TextFeaturizerTests.cs (5)
753Assert.Contains("SentimentText", outputSchema.Select(col => col.Name)); 754Assert.Contains("Label", outputSchema.Select(col => col.Name)); 755Assert.Contains("Features", outputSchema.Select(col => col.Name)); 756Assert.Contains("PredictedLabel", outputSchema.Select(col => col.Name)); 757Assert.Contains("Score", outputSchema.Select(col => col.Name));
Microsoft.ML.TimeSeries (11)
MovingAverageTransform.cs (1)
75_weights = string.IsNullOrWhiteSpace(args.Weights) ? null : args.Weights.Split(',').Select(c => Convert.ToSingle(c)).ToArray();
PredictionEngine.cs (1)
169var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
RootCauseAnalyzer.cs (2)
130return new Dictionary<string, object>(keyList.Select(dim => new KeyValuePair<string, object>(dim, dimension[dim])).ToDictionary(kvp => kvp.Key, kvp => kvp.Value)); 181rootCause.Items.AddRange(children.Select(anomaly =>
SeasonalityDetector.cs (2)
100periodogram.Select(t => t.Real).ToArray(), 101periodogram.Select(t => t.Imaginary).ToArray(),
SrCnnAnomalyDetectionBase.cs (1)
273List<Single> cumSumList = data.Select(x => cumsum += x).ToList();
SrCnnEntireAnomalyDetector.cs (4)
715GetDeanomalyData(values, GetAnomalyIndex(results.Select(x => x[1]).ToArray())); 739CalculateBoundaryUnit(values, results.Select(x => x[0] > 0).ToArray()); 831GetDeanomalyData(values, GetAnomalyIndex(results.Select(x => x[1]).ToArray())); 835CalculateBoundaryUnit(values, results.Select(x => x[0] > 0).ToArray());
Microsoft.ML.TimeSeries.Tests (1)
TimeSeriesDirectApi.cs (1)
1067var input = Enumerable.Range(0, 100).Select(x =>
Microsoft.ML.Tokenizers (3)
Model\SentencePieceTokenizer.cs (1)
90_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
PreTokenizer\RegexPreTokenizer.cs (1)
39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
Utils\TokenizerExtensions.cs (1)
19var values = keys.Select(getValue);
Microsoft.ML.Tokenizers.Tests (145)
BpeTests.cs (9)
258int[] encodingIds = encoding.Select(t => t.Id).ToArray(); 380Assert.Equal(encoding.Select(t => t.Id).ToArray(), ids); 432Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 433Assert.Equal(expectedOffsets, encoding.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 434Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 436Assert.Equal(expectedTokens, encoding1.Select(t => t.Value).ToArray()); 437Assert.Equal(expectedOffsets, encoding1.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 438Assert.Equal(expectedIds, encoding1.Select(t => t.Id).ToArray()); 528Assert.Equal(expectedTokens.Select(t => t.Id).ToArray(), ids);
CodeGenTests.cs (78)
236Assert.Equal(expectedIdsWithSpace, encoding.Select(t => t.Id).ToArray()); 237Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.Value).ToArray()); 238Assert.Equal(expectedOffsetsWithSpace, encoding.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 242Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 243Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 244Assert.Equal(expectedOffsets, encoding.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 253int[] ids = encoding.Select(t => t.Id).ToArray(); 256ids = encoding.Select(t => t.Id).ToArray(); 261ids = encoding.Select(t => t.Id).ToArray(); 264ids = encoding.Select(t => t.Id).ToArray(); 269ids = encoding.Select(t => t.Id).ToArray(); 272ids = encoding.Select(t => t.Id).ToArray(); 277ids = encoding.Select(t => t.Id).ToArray(); 280ids = encoding.Select(t => t.Id).ToArray(); 285ids = encoding.Select(t => t.Id).ToArray(); 288ids = encoding.Select(t => t.Id).ToArray(); 293ids = encoding.Select(t => t.Id).ToArray(); 297ids = encoding.Select(t => t.Id).ToArray(); 556Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 557Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 561Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 562Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 566Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 567Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 571Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 572Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 580Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 581Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 585Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 586Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 590Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 591Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 595Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 596Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 600Assert.Equal(expectedIdsWithSpace, encoding.Select(t => t.Id).ToArray()); 601Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.Value).ToArray()); 605Assert.Equal(expectedIdsWithSpace, encoding.Select(t => t.Id).ToArray()); 606Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.Value).ToArray()); 689Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 690Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 694Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 695Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 699Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 700Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 704Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 705Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 713Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 714Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 718Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 719Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 723Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 724Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 728Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 729Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 733Assert.Equal(expectedIdsWithSpace, encoding.Select(t => t.Id).ToArray()); 734Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.Value).ToArray()); 738Assert.Equal(expectedIdsWithSpace, encoding.Select(t => t.Id).ToArray()); 739Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.Value).ToArray()); 824Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 825Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 830Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 831Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 836Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 837Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 842Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 843Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 854Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 855Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 860Assert.Equal(idList, encoding.Select(t => t.Id).ToArray()); 861Assert.Equal(tokensList, encoding.Select(t => t.Value).ToArray()); 866Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 867Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 872Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 873Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 878Assert.Equal(expectedIdsWithSpace, encoding.Select(t => t.Id).ToArray()); 879Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.Value).ToArray()); 884Assert.Equal(expectedIdsWithSpace, encoding.Select(t => t.Id).ToArray()); 885Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.Value).ToArray());
EnglishRobertaTests.cs (9)
184Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 185Assert.Equal(expectedOffsets, encoding.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 186Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 188Assert.Equal(expectedTokens, encoding1.Select(t => t.Value).ToArray()); 189Assert.Equal(expectedOffsets, encoding1.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 190Assert.Equal(expectedIds, encoding1.Select(t => t.Id).ToArray()); 266int[] encodingIds = encoding.Select(t => t.Id).ToArray(); 267(int, int)[] offsets = encoding.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray(); 268string[] tokens = encoding.Select(t => t.Value).ToArray();
LlamaTests.cs (24)
245Assert.Equal(ids, result.Select(t => t.Id).ToArray()); 246Assert.Equal(tokens, result.Select(t => t.Value).ToArray()); 247Assert.Equal(offsets, result.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 267Assert.Equal(ids.Skip(1), bpeTokens.Select(token => token.Id)); 268Assert.Equal(tokens.Skip(1), bpeTokens.Select(token => token.Value)); 269int[] extractedIds = bpeTokens.Select(token => token.Id).ToArray(); 277Assert.Equal(isEmptyInput ? Array.Empty<int>() : ids.Skip(1).Concat(new[] { bpe.EndOfSentenceId }), bpeTokens.Select(token => token.Id)); 278Assert.Equal(isEmptyInput ? Array.Empty<string>() : tokens.Skip(1).Concat(new[] { bpe.EndOfSentenceToken }), bpeTokens.Select(token => token.Value)); 279extractedIds = bpeTokens.Select(token => token.Id).ToArray(); 287Assert.Equal(isEmptyInput ? Array.Empty<int>() : ids.Concat(new[] { bpe.EndOfSentenceId }), bpeTokens.Select(token => token.Id)); 288Assert.Equal(isEmptyInput ? Array.Empty<string>() : tokens.Concat(new[] { bpe.EndOfSentenceToken }), bpeTokens.Select(token => token.Value)); 289extractedIds = bpeTokens.Select(token => token.Id).ToArray(); 503Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 504Assert.Equal(expectedOffsets, encoding.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 505Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 507Assert.Equal(expectedTokens, encoding1.Select(t => t.Value).ToArray()); 508Assert.Equal(expectedOffsets, encoding1.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 509Assert.Equal(expectedIds, encoding1.Select(t => t.Id).ToArray()); 541Assert.Equal(expectedTokens1, encoding.Select(t => t.Value).ToArray()); 542Assert.Equal(expectedOffsets1, encoding.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 543Assert.Equal(expectedIds1, encoding.Select(t => t.Id).ToArray()); 665Assert.Equal(new[] { tokenizer.BeginningOfSentenceToken, kvp.Key }, encodedTokens.Select(et => et.Value).ToArray()); 666Assert.Equal(new[] { tokenizer.BeginningOfSentenceId, kvp.Value }, encodedTokens.Select(et => et.Id).ToArray()); 670Assert.Equal(encodedIds, encodedTokens.Select(et => et.Id).ToArray());
TiktokenTests.cs (24)
146int[] ids = result.Select(token => token.Id).ToArray(); 147string[] tokens = result.Select(token => token.Value).ToArray(); 148Range[] offsets = result.Select(token => token.Offset).ToArray(); 199int[] ids = result.Select(token => token.Id).ToArray(); 200string[] tokens = result.Select(token => token.Value).ToArray(); 201(int, int)[] offsets = result.Select(token => (token.Offset.Start.Value, token.Offset.End.Value - token.Offset.Start.Value)).ToArray(); 240int[] ids = result.Select(token => token.Id).ToArray(); 241string[] tokens = result.Select(token => token.Value).ToArray(); 242(int, int)[] offsets = result.Select(token => (token.Offset.Start.Value, token.Offset.End.Value - token.Offset.Start.Value)).ToArray(); 275Assert.Equal(encoded, result.Select(token => token.Id).ToArray()); 277Assert.Equal(new string[] { "<|im_start|>", "Hello", " ⭐", "⭐", " World", "<|im_end|>" }, result.Select(token => token.Value).ToArray()); 278Assert.Equal(new List<(int, int)> { (0, 12), (12, 5), (17, 2), (18, 1), (19, 6), (25, 10) }, result.Select(token => (token.Offset.Start.Value, token.Offset.End.Value - token.Offset.Start.Value)).ToArray()); 310Assert.Equal(encoded, result.Select(token => token.Id).ToArray()); 312Assert.Equal(new string[] { "<|endoftext|>", "Hello", " ⭐", " World", "<|endofprompt|>" }, result.Select(token => token.Value).ToArray()); 313Assert.Equal(new List<(int, int)> { (0, 13), (13, 5), (18, 2), (20, 6), (26, 15) }, result.Select(token => (token.Offset.Start.Value, token.Offset.End.Value - token.Offset.Start.Value)).ToArray()); 571Assert.Equal(expectedTokens, encoding.Select(t => t.Value).ToArray()); 572Assert.Equal(expectedOffsets, encoding.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 573Assert.Equal(expectedIds, encoding.Select(t => t.Id).ToArray()); 575Assert.Equal(expectedTokens, encoding1.Select(t => t.Value).ToArray()); 576Assert.Equal(expectedOffsets, encoding1.Select(t => (t.Offset.Start.Value, t.Offset.End.Value - t.Offset.Start.Value)).ToArray()); 577Assert.Equal(expectedIds, encoding1.Select(t => t.Id).ToArray()); 684int[] ids = result.Select(r => r.Id).ToArray(); 685(int Index, int Length)[] offsets = result.Select(r => (r.Offset.Start.Value, r.Offset.End.Value - r.Offset.Start.Value)).ToArray(); 686Assert.Equal(expectedTokens, result.Select(r => r.Value));
TokenizerTests.cs (1)
26tokenizer.Decode(Enumerable.Repeat("abcdefghijklmnopqrstuvwxyz", 100).SelectMany(s => s.Select(c => c - 'a'))));
Microsoft.ML.TorchSharp (15)
AutoFormerV2\Anchors.cs (2)
46this.strides = strides != null ? strides : this.pyramidLevels.Select(x => (int)Math.Pow(2, x)).ToArray(); 47this.sizes = sizes != null ? sizes : this.pyramidLevels.Select(x => (int)Math.Pow(2, x + 2)).ToArray();
NasBert\Models\NasBertEncoder.cs (3)
107.Select(i => new TransformerCellDiscrete( 125.Select(i => new HiddenTransferDiscrete(hiddenSizePerBlockExtend[i], hiddenSizePerBlockExtend[i + 1])) 260.Select(j => ArchHiddenSize[DiscreteArches[j]]).ToArray();
NasBert\Modules\EmbedTransfer.cs (1)
33.Select(hidden => torch.nn.Linear(hidden, SearchSpace.HiddenSizeChoices[SearchSpace.HiddenSizeChoices.Length - 1]))
NasBert\Modules\TransformerCell.cs (1)
53.Select(i => SearchSpace.GetLayer(i, dropout, attentionDropout, activationDropout, activationFn,
NasBert\NerTrainer.cs (2)
129var tl = target.DenseValues().Select(item => (long)item).ToList(); 190t = torch.tensor((ZeroArray).Concat(Tokenizer.RobertaModel().ConvertIdsToOccurrenceRanks(encoding.Select(t => t.Id).ToArray())).ToList(), device: Device);
NasBert\Optimizers\BaseOptimizer.cs (2)
66.Select(p => p.grad) 68.Select(grad => grad.square().sum().ToDouble())
Roberta\Modules\Encoder.cs (1)
28.Select(_ => new Layer(numAttentionHeads, hiddenSize, ffnHiddenSize,
Roberta\QATrainer.cs (2)
405var contextToken = contextTokens.Select(t => t.Value).ToArray(); 406var contextTokenId = Tokenizer.RobertaModel().ConvertIdsToOccurrenceRanks(contextTokens.Select(t => t.Id).ToArray());
Utils\DataUtils.cs (1)
23var size = values.Select(v => v.size(0)).Max();
Microsoft.ML.TorchSharp.Tests (2)
TextClassificationTests.cs (2)
446var predictions = transformedData.GetColumn<float>("relevance").ToArray().Select(num => (double)num).ToArray(); 447var targets = transformedData.GetColumn<float>("Score").ToArray().Select(num => (double)num).ToArray();
Microsoft.ML.Transforms (60)
CategoricalCatalog.cs (2)
86var columnOptions = columns.Select(x => new OneHotEncodingEstimator.ColumnOptions(x.OutputColumnName, x.InputColumnName, outputKind, maximumNumberOfKeys, keyOrdinality)).ToArray(); 186var columnOptions = columns.Select(x => new OneHotHashEncodingEstimator.ColumnOptions(x.OutputColumnName, x.InputColumnName, outputKind, numberOfBits, seed, useOrderedHashing, maximumNumberOfInverts)).ToArray();
CountFeatureSelection.cs (3)
196var scores = CountFeatureSelectionUtils.Train(_host, input, _columns.Select(column => column.InputColumnName).ToArray(), out colSizes); 236var columnOptions = options.Columns.Select(inColName => new ColumnOptions(inColName, count: options.Count)).ToArray(); 346return aggregators.Select(a => a.Count).ToArray();
CustomMappingTransformer.cs (1)
192return Enumerable.Range(0, dstRow.Schema.Count).Select(x => new DataViewSchema.DetachedColumn(dstRow.Schema[x])).ToArray();
Dracula\CMCountTable.cs (1)
262var priorCounts = PriorCounts.Select(x => (float)x).ToArray();
Dracula\CountTableTransformer.cs (6)
93_builders = columns.Select(c => c.CountTableBuilder).ToArray(); 172var featurizer = new CountTargetEncodingFeaturizer(_host, _columns.Select(col => col.PriorCoefficient).ToArray(), _columns.Select(col => col.LaplaceScale).ToArray(), labelCardinality, multiCountTable); 175_columns.Select(col => col.Seed).ToArray(), _columns.Select(col => (col.Name, col.InputColumnName)).ToArray()); 317return keyNames.DenseValues().Select(name => name.ToString()).ToArray();
Dracula\CountTargetEncodingTransformer.cs (3)
127columnOptions.Select(col => new CountTableEstimator.ColumnOptions(col.Name, col.Name, col.CountTableBuilder, col.PriorCoefficient, col.LaplaceScale, col.Seed)).ToArray()), 136columnOptions.Select(col => new CountTableEstimator.SharedColumnOptions(col.Name, col.Name, col.PriorCoefficient, col.LaplaceScale, col.Seed)).ToArray()), 151columns.Select(c => new InputOutputColumnPair(c.OutputColumnName, c.OutputColumnName)).ToArray());
Dracula\DictCountTable.cs (2)
200var priorCounts = PriorCounts.Select(x => (float)x).ToArray(); 270outputGarbageCounts = garbageCounts.Select(x => (float)x).ToArray();
Dracula\MultiCountTable.cs (1)
139public override int[] SlotCount => _countTables.Select(ct => ct.Length).ToArray();
EntryPoints\TextAnalytics.cs (1)
123var cols = input.Columns.Select(colPair => new LatentDirichletAllocationEstimator.ColumnOptions(colPair, input)).ToArray();
Expression\LambdaBinder.cs (3)
1300var kinds = node.Args.Items.Select(item => item.AsExpr.ExprType).ToArray(); 1351var arities = candidates.Select(c => c.Arity).Distinct().OrderBy(x => x).ToArray(); 1365var kindsRet = candidates.Select(c => c.ReturnKind).Distinct().ToArray();
ExtensionsCatalog.cs (2)
56return new MissingValueIndicatorEstimator(env, columns.Select(x => (x.OutputColumnName, x.InputColumnName)).ToArray()); 109var columnOptions = columns.Select(x => new MissingValueReplacingEstimator.ColumnOptions(x.OutputColumnName, x.InputColumnName, replacementMode, imputeBySlot)).ToArray();
FeatureSelectionCatalog.cs (2)
68columns.Select(x => (x.OutputColumnName, x.InputColumnName)).ToArray()); 124var columnOptions = columns.Select(x => new CountFeatureSelectingEstimator.ColumnOptions(x.OutputColumnName, x.InputColumnName, count)).ToArray();
GcnTransform.cs (3)
192return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 1006: this(env, columns.Select(x => new ColumnOptions(x.outputColumnName, x.inputColumnName, norm, ensureZeroMean)).ToArray()) 1090: this(env, columns.Select(x => new ColumnOptions(x.outputColumnName, x.inputColumnName, ensureZeroMean, ensureUnitStandardDeviation, scale)).ToArray())
HashJoiningTransform.cs (1)
380return Enumerable.Range(0, srcSlotCount).Select(v => new[] { v }).ToArray();
MissingValueReplacing.cs (1)
184return columns.Select(x => (x.Name, x.InputColumnName)).ToArray();
MutualInformationFeatureSelection.cs (1)
269(string outputColumnName, string inputColumnName)[] cols = options.Columns.Select(col => (col, col)).ToArray();
OneHotEncoding.cs (1)
309toBinVector = new KeyToBinaryVectorMappingEstimator(_host, binaryCols.Select(x => (x.outputColumnName, x.inputColumnName)).ToArray());
OneHotHashEncoding.cs (2)
328_hash = new HashingEstimator(_host, columns.Select(x => x.HashingOptions).ToArray()); 359toBinVector = new KeyToBinaryVectorMappingEstimator(_host, binaryCols.Select(x => (x.outputColumnName, x.inputColumnName)).ToArray());
OptionalColumnTransform.cs (1)
377var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
RandomFourierFeaturizing.cs (1)
239return columns.Select(x => (x.Name, x.InputColumnName)).ToArray();
StatefulCustomMappingTransformer.cs (1)
122var cols = Enumerable.Range(0, dstRow.Schema.Count).Select(x => new DataViewSchema.DetachedColumn(dstRow.Schema[x])).ToArray();
StatefulFilterTransform.cs (1)
165var columnNames = columnsNeeded.Select(c => c.Name);
SvmLight\SvmLightLoaderSaverCatalog.cs (1)
141saver.SaveData(stream, data, data.Schema.Select(col => col.Index).ToArray());
Text\LdaSingleBox.cs (1)
170logLikelihood = pLogLikelihood.Select(item => (float)item).ToArray();
Text\LdaTransform.cs (2)
648return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 728var cols = options.Columns.Select(colPair => new LatentDirichletAllocationEstimator.ColumnOptions(colPair, options)).ToArray();
Text\NgramTransform.cs (2)
197return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 936: this(env, columns.Select(x => new ColumnOptions(x.outputColumnName, x.inputColumnName, ngramLength, skipLength, useAllLengths, weighting, maximumNgramsCount)).ToArray())
Text\SentimentAnalyzingTransform.cs (3)
134return new ColumnCopyingTransformer(env, hiddenNames.Select(x => (Name: x.Key, Source: x.Value)).ToArray()).Transform(input); 142input = new ColumnCopyingTransformer(env, hiddenNames.Select(x => (outputColumnName: x.Key, inputColumnName: x.Value)).ToArray()).Transform(input); 143return ColumnSelectingTransformer.CreateDrop(env, input, hiddenNames.Select(pair => pair.Value).ToArray());
Text\StopWordsRemovingTransformer.cs (2)
184return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 656: this(env, columns.Select(x => new ColumnOptions(x.outputColumnName, x.inputColumnName, language)).ToArray())
Text\TextFeaturizingEstimator.cs (1)
601srcTaggedCols.Select(kvp => (kvp.Value, kvp.Key)))), ref view);
Text\TokenizingByCharacters.cs (2)
260IEnumerable<string> charStrings = Enumerable.Range(0, 65535).Select(x => ((char)x).ToString()); 261IEnumerable<long> charValues = Enumerable.Range(0, 65535).Select(x => Convert.ToInt64(x));
Text\WordBagTransform.cs (1)
522chain = chain.Append<ITransformer>(new MissingValueDroppingEstimator(h, missingDropColumns.Select(x => (x, x)).ToArray()));
Text\WordEmbeddingsExtractor.cs (2)
215return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 715float[] firstValue = wordsInFirstLine.Skip(1).Select(x => float.TryParse(x, out temp) ? temp : Single.NaN).ToArray();
Text\WordTokenizing.cs (3)
113return columns.Select(x => (x.Name, x.InputColumnName)).ToArray(); 415string[] separators = column.SeparatorsArray.Select(c => c.ToString()).ToArray(); 479: this(env, columns.Select(x => new ColumnOptions(x.outputColumnName, x.inputColumnName, separators)).ToArray())
Microsoft.ML.Vision (8)
DnnRetrainTransform.cs (6)
549(_tfInputTypes, _tfInputShapes, _tfInputOperations) = GetInputInfo(Host, _session, _inputs.Select(x => _idvToTfMapping[x]).ToArray(), batchSize); 621return new TensorShape(dims.Select(x => (int)x).ToArray()); 929_parent._inputs.Select(x => _parent._idvToTfMapping[x]).ToArray(), 930_parent._outputs.Select(x => _parent._idvToTfMapping[x]).ToArray()); 991_dims = _tfShape.dims.Select(x => (long)x).ToArray(); 1080_dims = _tfShape.dims.Select(x => (long)x).ToArray();
ImageClassificationTrainer.cs (2)
979var labelTensorShape = _labelTensor.TensorShape.dims.Select(x => (long)x).ToArray(); 980var featureTensorShape = _bottleneckInput.TensorShape.dims.Select(x => (long)x).ToArray();
Microsoft.Net.Http.Headers (2)
MediaTypeHeaderValue.cs (2)
411_parameters.Select(item => item.Copy())); 433_parameters.Select(item => item.CopyAsReadOnly()), isReadOnly: true);
Microsoft.NET.StringTools (1)
WeakStringCacheInterner.cs (1)
154.Select(kv => string.Format(CultureInfo.InvariantCulture, "({1} instances x each {2} chars)\n{0}", kv.Key, kv.Value, kv.Key.Length));
Microsoft.NET.StringTools.net35 (1)
WeakStringCacheInterner.cs (1)
154.Select(kv => string.Format(CultureInfo.InvariantCulture, "({1} instances x each {2} chars)\n{0}", kv.Key, kv.Value, kv.Key.Length));
Microsoft.TestUtilities (1)
XUnit\TestMethodExtensions.cs (1)
23.Select(attributeInfo => attributeInfo.Attribute);
Microsoft.VisualBasic.Tests (6)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (6)
105var tasks = Enumerable.Range(0, n).Select(i => Task.Factory.StartNew(() => 133string[][] sentArgs = Enumerable.Range(0, n).Select(i => Enumerable.Range(0, i).Select(i => i.ToString()).ToArray()).ToArray(); 154string[][] sentArgs = Enumerable.Range(0, n).Select(i => Enumerable.Range(0, i).Select(i => i.ToString()).ToArray()).ToArray(); 157var tasks = Enumerable.Range(0, n).Select(i => Task.Factory.StartNew(() => { Assert.True(SendSecondInstanceArgs(pipeName, SendTimeout, sentArgs[i])); }, cancellationToken: default, creationOptions: default, scheduler: TaskScheduler.Default)).ToArray();
Microsoft.VisualStudio.LanguageServices (35)
CallHierarchy\CallHierarchyItem.cs (1)
106return _finders.Select(s => new CallHierarchySearchCategory(s.SearchCategory, s.DisplayName));
CallHierarchy\Finders\AbstractCallFinder.cs (1)
160initializerLocations.AddRange(caller.Locations.Select(
ChangeSignature\ChangeSignatureDialogViewModel.cs (6)
283_parametersWithoutDefaultValues.Where(p => !p.IsRemoved).Select(p => p.Parameter).ToImmutableArray(), 284_parametersWithDefaultValues.Where(p => !p.IsRemoved).Select(p => p.Parameter).ToImmutableArray(), 339return GetSignatureDisplayParts().Select(sdp => sdp.ToString()).Join(" "); 344=> GetSignatureDisplayParts().Select(p => p.ToString()).Join(""); 481!_parametersWithoutDefaultValues.OfType<ExistingParameterViewModel>().Select(p => p.ParameterSymbol).SequenceEqual(_originalParameterConfiguration.ParametersWithoutDefaultValues.Cast<ExistingParameter>().Select(p => p.Symbol)) || 482!_parametersWithDefaultValues.OfType<ExistingParameterViewModel>().Select(p => p.ParameterSymbol).SequenceEqual(_originalParameterConfiguration.RemainingEditableParameters.Cast<ExistingParameter>().Select(p => p.Symbol));
ColorSchemes\ColorSchemeApplier.ColorSchemeReader.cs (2)
32.Select(ReadColorTheme); 55.Select(ReadColorItem)
ErrorReporting\VisualStudioErrorReportingService.ExceptionFormatting.cs (2)
168stringBuilder.Append("[" + string.Join(",", genericTypeArguments.Select(args => args.Name)) + "]"); 172=> stringBuilder.Append(string.Join(",", method?.GetParameters().Select(t => (t.ParameterType?.Name ?? "<UnknownType>") + " " + t.Name) ?? Array.Empty<string>()));
ExtractInterface\VisualStudioExtractInterfaceOptionsService.cs (1)
79var includedMembers = viewModel.MemberContainers.Where(c => c.IsChecked).Select(c => c.Symbol);
GenerateType\GenerateTypeDialogViewModel.cs (2)
309this.FullFilePath = string.Join("\\", fileNameInFullPathInContainers.Select(str => str.Trim())); 741.Select(p => new ProjectSelectItem(p)));
MoveToNamespace\MoveToNamespaceDialogViewModel.cs (1)
30.Concat(availableNamespaces.Except(namespaceHistory).Select(n => new NamespaceItem(false, n)))
PickMembers\VisualStudioPickMembersService.cs (1)
42.Select(c => c.Symbol)
Preview\ReferenceChange.cs (6)
38.Select(r => new MetadataReferenceChange(r, projectId, projectName, isAdded: true, engine: engine)); 43.Select(r => new MetadataReferenceChange(r, projectId, projectName, isAdded: false, engine: engine)); 49.Select(r => new ProjectReferenceChange(r, newSolution.GetProject(r.ProjectId).Name, projectId, projectName, isAdded: true, engine: engine)); 54.Select(r => new ProjectReferenceChange(r, oldSolution.GetProject(r.ProjectId).Name, projectId, projectName, isAdded: false, engine: engine)); 60.Select(r => new AnalyzerReferenceChange(r, projectId, projectName, isAdded: true, engine: engine)); 65.Select(r => new AnalyzerReferenceChange(r, projectId, projectName, isAdded: false, engine: engine));
Progression\GraphQueries\IsUsedByGraphQuery.cs (1)
34var allLocations = referencedSymbol.Locations.Concat(reference.Locations.Select(r => r.Location))
ProjectSystem\VisualStudioWorkspaceImpl.cs (1)
1446var fileNames = documents.Select(GetFilePath).ToArray();
Snippets\SnippetExpansionClient.cs (1)
1086var existingReferenceNames = originalProject.MetadataReferences.Select(r => Path.GetFileNameWithoutExtension(r.Display));
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (1)
449return codeFixService.GetSuppressionFixer(language, diagnostics.Select(d => d.Id));
Utilities\InlineExtensions.cs (1)
16Hyperlink hyperlink => string.Join("", hyperlink.Inlines.Select(GetText)),
Venus\ContainedLanguage.IVsContainedCode.cs (1)
55.Select(tuple => new TextSpanAndCookie
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (4)
121CreateBSTRArray(ppbstrEventHandlerNames, membersAndIds.Select(t => t.Item1)); 122CreateBSTRArray(ppbstrMemberIDs, membersAndIds.Select(t => t.Item2)); 182CreateBSTRArray(ppbstrDisplayNames, membersAndIds.Select(t => t.Item1)); 183CreateBSTRArray(ppbstrMemberIDs, membersAndIds.Select(t => t.Item2));
Venus\ContainedLanguageCodeSupport.cs (2)
66var typeNode = type.DeclaringSyntaxReferences.Where(r => r.SyntaxTree == tree).Select(r => r.GetSyntax(cancellationToken)).First(); 304return members.Select(m => Tuple.Create(m.Name, ConstructMemberId(m)));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
Interactive\Commands\ResetInteractiveTests.cs (3)
53var replReferenceCommands = GetProjectReferences(workspace, project).Select(r => CreateReplReferenceCommand(r)); 121expectedSubmissions.AddRange(expectedReferences.Select(r => r + newLineCharacter)); 142var metadataReferences = project.MetadataReferences.Select(r => r.Display);
Microsoft.VisualStudio.LanguageServices.LiveShare (4)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (2)
78.Select(f => lspClient.ProtocolConverter.FromProtocolUriAsync(f, false, cancellationToken)); 80var projectInfo = CreateProjectInfo(project.Name, project.Language, files.Select(f => f.LocalPath).ToImmutableArray(), _remoteLanguageServiceWorkspace.Services.SolutionServices);
Client\RemoteLanguageServiceWorkspace.cs (1)
169var localPathsOfRemoteRoots = roots.Select(root => session.ConvertSharedUriToLocalPath(root)).ToImmutableArray();
ProjectsHandler.cs (1)
46SourceFiles = project.Documents.Select(d => requestContext.ProtocolConverter.ToProtocolUri(new Uri(d.FilePath))).ToArray(),
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\Handler\Hover\HoverHandler.cs (1)
97=> string.Join("\r\n", description.Select(section => section.Text).Where(text => !string.IsNullOrEmpty(text)));
MSBuild (2)
BuildEnvironmentHelper.cs (1)
336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name)))
PrintLineDebuggerWriters.cs (1)
95var joinedArgs = $"{EscapeCommas(callsite)},{string.Join(",", args.Select(arg => EscapeCommas(arg)))}\n";
MSBuildTaskHost (1)
BuildEnvironmentHelper.cs (1)
336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name)))
Mvc.RoutingWebSite (2)
Controllers\ConventionalControllerWithMetadata.cs (1)
14return Ok(HttpContext.GetEndpoint().Metadata.GetOrderedMetadata<MetadataAttribute>().Select(m => m.Value));
Controllers\RouteDataController.cs (1)
38var routers = RouteData.Routers.Select(r => r.GetType().FullName).ToArray();
OpenIdConnectSample (3)
Startup.cs (3)
283await WriteTableHeader(res, new string[] { "Token Type", "Value" }, props.GetTokens().Select(token => new string[] { token.Name, token.Value })); 319await WriteTableHeader(res, new string[] { "Claim Type", "Value" }, context.User.Claims.Select(c => new string[] { c.Type, c.Value })); 322await WriteTableHeader(res, new string[] { "Token Type", "Value" }, props.GetTokens().Select(token => new string[] { token.Name, token.Value }));
PresentationBuildTasks (2)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (1)
818foreach (string sdk in sdks.Split(s_semicolonChar).Select(i => i.Trim()))
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (1)
392HashSet<string> localMarkupPages = new HashSet<string>(_mcPass1.PageMarkup.Select(x => x.GetMetadata(SharedStrings.FullPath)), StringComparer.OrdinalIgnoreCase);
PresentationFramework (2)
MS\Internal\WindowsRuntime\Generated\WinRT\GuidGenerator.cs (2)
47var args = type.GetGenericArguments().Select(t => GetSignature(t)); 77var args = type.GetFields(BindingFlags.Instance | BindingFlags.Public).Select(fi => GetSignature(fi.FieldType));
ProjectCachePlugin (1)
AssemblyMockCache.cs (1)
32? string.Join("\n\t", ep.GlobalProperties.Select(gp => $"{gp.Key}:{gp.Value}"))
Qdrant.ApiService (1)
Program.cs (1)
88return results.Select(titles => titles.Payload["title"].StringValue);
Roslyn.Test.PdbUtilities (3)
Reader\MethodDebugInfoBytes.cs (1)
48var groupSizes = importStringGroups.Select(g => (short)g.Length).ToArray();
Reader\PdbValidation.cs (2)
93VerifyPdb(diff, methodHandles.Select(h => MetadataTokens.GetToken(h)), expectedPdb); 98VerifyPdb(diff, methodHandles.Select(h => MetadataTokens.GetToken(h)), expectedPdb);
Roslyn.VisualStudio.DiagnosticsWindow (2)
VenusMargin\ProjectionBufferMargin.xaml.cs (1)
32TextView.Properties[ProjectionSpanTaggerProvider.PropertyName] = new List<Span>(e.AddedItems.Cast<SnapshotSpan>().Select(ss => ss.Span).Where(ss => !ss.IsEmpty));
VenusMargin\ProjectionSpanTagger.cs (1)
71.Select(s => new TagSpan<TextMarkerTag>(new SnapshotSpan(spans.First().Snapshot, s), ProjectionSpanTag.Instance));
RoutingWebSite (1)
UseEndpointRoutingStartup.cs (1)
135: string.Join(",", hosts.Select(h => h.Contains(':') ? h : h + ":*"));
RunTests (6)
AssemblyScheduler.cs (5)
25var assembliesString = string.Join("_", Filters.Keys.Select(a => Path.GetFileNameWithoutExtension(a.AssemblyName))); 175var allTests = assemblyTypes.Values.SelectMany(v => v).SelectMany(v => v.Tests).Select(t => t.FullyQualifiedName).ToList(); 200typeInfos = typeInfos.RemoveRange(singlePartitionAssemblies.Select(kvp => kvp.Key)); 323.Select(group => new TypeInfo(GetName(group.Key), group.Key, group.Select(test => new TestMethodInfo(GetName(test), test, TimeSpan.Zero)).ToImmutableArray()))
ProcessTestExecutor.cs (1)
23var assemblyPaths = workItem.Filters.Keys.Select(assembly => assembly.AssemblyPath);
SemanticSearch.BuildTask (2)
GenerateFilteredReferenceAssembliesTask.cs (2)
82ExecuteImpl(ApiSets.Select(item => (item.ItemSpec, (IReadOnlyList<string>)File.ReadAllLines(item.ItemSpec)))); 193=> new("^" + string.Join(".*", pattern.Trim().Split('*').Select(Regex.Escape)) + "$",
Shared.Tests (3)
JsonSchemaExporter\SchemaTestHelpers.cs (1)
38.SelectMany(d => d.Errors!.Select(error => $"Path:${d.InstanceLocation} {error.Key}:{error.Value}"));
JsonSchemaExporter\TestTypes.cs (2)
35public static IEnumerable<object[]> GetTestData() => GetTestDataCore().Select(t => new object[] { t }); 40.Select(t => new object[] { t });
SocialSample (1)
Startup.cs (1)
220context.Failure.Message.Split(Environment.NewLine).Select(s => HtmlEncoder.Default.Encode(s) + "<br>").Aggregate((s1, s2) => s1 + s2));
Sockets.BindTests (9)
src\Servers\Kestrel\shared\test\TransportTestHelpers\DiagnosticMemoryPoolFactory.cs (1)
41return Task.WhenAll(_pools.Select(p => p.WhenAllBlocksReturnedAsync(span)));
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (2)
25.Select(u => u.Port); 31.Select(a => new Uri(a));
src\Servers\Kestrel\shared\test\TransportTestHelpers\IWebHostPortExtensions.cs (2)
21.Select(u => u.Port); 27.Select(a => new Uri(a));
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (4)
203foreach (var testUrl in testUrls.Select(testUrl => $"{testUrl}:{(testPort == 0 ? host.GetPort() : testPort)}")) 386foreach (var testUrl in testUrls.Select(testUrl => $"{testUrl}:{(testPort == 0 ? host.GetPort() : testPort)}")) 433foreach (var testUrl in testUrls.Select(testUrl => $"{testUrl}:{(testPort == 0 ? host.GetPort() : testPort)}")) 1182.Select(a => a.Address);
Sockets.FunctionalTests (5)
src\Servers\Kestrel\shared\test\TransportTestHelpers\DiagnosticMemoryPoolFactory.cs (1)
41return Task.WhenAll(_pools.Select(p => p.WhenAllBlocksReturnedAsync(span)));
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (2)
25.Select(u => u.Port); 31.Select(a => new Uri(a));
src\Servers\Kestrel\shared\test\TransportTestHelpers\IWebHostPortExtensions.cs (2)
21.Select(u => u.Port); 27.Select(a => new Uri(a));
System.Collections.Immutable (7)
System\Collections\Immutable\ImmutableDictionary.cs (1)
149.AddRange(source.Select(element => new KeyValuePair<TKey, TValue>(keySelector(element), elementSelector(element))));
System\Collections\Immutable\ImmutableEnumerableDebuggerProxy.cs (1)
46??= _dictionary.Select(kv => new DebugViewDictionaryItem<TKey, TValue>(kv)).ToArray(_dictionary.Count);
System\Collections\Immutable\ImmutableList_1.Node.cs (1)
944return root.AddRange(Linq.Enumerable.Select(this, converter));
System\Collections\Immutable\ImmutableSortedDictionary.cs (1)
145.AddRange(source.Select(element => new KeyValuePair<TKey, TValue>(keySelector(element), elementSelector(element))));
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (2)
136get { return Linq.Enumerable.Select(this, p => p.Key); } 144get { return Linq.Enumerable.Select(this, p => p.Value); }
System\Linq\ImmutableArrayExtensions.cs (1)
31return immutableArray.array!.Select(selector);
System.ComponentModel.Annotations (4)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (3)
149HashSet<string> mainTypeMemberNames = new HashSet<string>(mainType.GetProperties().Select(p => p.Name)); 152var buddyFields = associatedMetadataType.GetFields().Select(f => f.Name); 153var buddyProperties = associatedMetadataType.GetProperties().Select(p => p.Name);
System\ComponentModel\DataAnnotations\FileExtensionsAttribute.cs (1)
39get { return ExtensionsNormalized.Split(',').Select(e => "." + e); }
System.ComponentModel.Composition (9)
System\ComponentModel\Composition\AttributedModelServices.cs (1)
154attributedParts.Select(AttributedModelServices.CreatePart).ToArray(),
System\ComponentModel\Composition\Hosting\CompositionServices.cs (1)
487return properties.Select(property => new KeyValuePair<string, Type>(property.Name, property.PropertyType));
System\ComponentModel\Composition\Hosting\DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs (1)
30return _catalog._assemblyCatalogs.Values.Select(catalog => catalog.Assembly)
System\ComponentModel\Composition\Hosting\ExportsChangeEventArgs.cs (1)
99.Select(export => export.ContractName)
System\ComponentModel\Composition\Hosting\ImportEngine.PartManager.cs (1)
68return _importedContractNames ??= Part.ImportDefinitions.Select(import => import.ContractName ?? ImportDefinition.EmptyContractName).Distinct().ToArray();
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (1)
322foreach (string contractName in part.ExportDefinitions.Select(export => export.ContractName).Distinct())
System\ComponentModel\Composition\ReflectionModel\GenericServices.cs (2)
68return type.GetPureGenericParameters().Select(parameter => parameter.GenericParameterPosition).ToArray(); 100return types.Select(type => type.CreateTypeSpecialization(specializationTypes));
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (1)
362.Select(parameterImport => parameterImport.ImportingLazyParameter.Value.Member)
System.Composition.Hosting (10)
System\Composition\Hosting\Core\CompositionDependency.cs (1)
170var list = Formatters.ReadableList(_oversuppliedTargets.Select(t => SR.Format(SR.Dependency_QuoteParameter, t.Origin)));
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (2)
49var descriptors = result.Value.GetResults().Select(cb => cb.GetDescriptor()).ToArray(); 141return definitions.Select(d => new ExportDescriptorPromise(contract, "Preexisting", false, s_noDependencies, _ => d)).ToArray();
System\Composition\Hosting\Providers\ExportFactory\ExportFactoryExportDescriptorProvider.cs (1)
40.Select(d => new ExportDescriptorPromise(
System\Composition\Hosting\Providers\ExportFactory\ExportFactoryWithMetadataExportDescriptorProvider.cs (1)
45.Select(d => new ExportDescriptorPromise(
System\Composition\Hosting\Providers\ImportMany\ImportManyExportDescriptorProvider.cs (2)
49.Select(el => el.Target.GetDescriptor()) 52return ExportDescriptor.Create((c, o) => dependentDescriptors.Select(e => (TElement)e.Activator(c, o)).ToArray(), NoMetadata);
System\Composition\Hosting\Providers\Lazy\LazyExportDescriptorProvider.cs (1)
30.Select(d => new ExportDescriptorPromise(
System\Composition\Hosting\Providers\Lazy\LazyWithMetadataExportDescriptorProvider.cs (1)
33.Select(d => new ExportDescriptorPromise(
System\Composition\Hosting\Util\Formatters.cs (1)
49var args = closedGenericType.GenericTypeArguments.Select(Format);
System.Composition.Runtime (2)
System\Composition\Hosting\Core\CompositionContract.cs (1)
113_metadataConstraints.Select(kv => $"{kv.Key} = {Formatters.Format(kv.Value)}")));
System\Composition\Runtime\Util\Formatters.cs (1)
28IEnumerable<string> args = closedGenericType.GenericTypeArguments.Select(Format);
System.Composition.TypedParts (2)
System\Composition\Hosting\ContainerConfiguration.cs (1)
217return WithParts(assemblies.SelectMany(a => a.DefinedTypes.Select(dt => dt.AsType())), conventions);
System\Composition\TypedParts\TypedPartExportDescriptorProvider.cs (1)
73return forKey.Select(de => de.GetExportDescriptorPromise(contract, definitionAccessor)).ToArray();
System.Data.Common (2)
System\Data\EnumerableRowCollectionExtensions.cs (1)
131IEnumerable<S> typedEnumerable = Enumerable.Select(source, selector);
System\Data\TypeLimiter.cs (1)
110? dataTable.Columns.Cast<DataColumn>().Select(column => column.DataType)
System.Drawing.Common.Tests (11)
System\Drawing\BitmapTests.cs (1)
1440Assert.Equal(expectedEntries, bitmap.Palette.Entries.Select(c => c.ToArgb()));
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (3)
383Assert.Equal(blend.Colors.Select(c => Color.FromArgb(c.ToArgb())), brush.InterpolationColors.Colors); 404Assert.Equal(blend.Colors.Select(c => Color.FromArgb(c.ToArgb())), brush.InterpolationColors.Colors); 536Assert.Equal(colors.Take(2).Select(c => Color.FromArgb(c.ToArgb())), brush.LinearColors);
System\Drawing\Drawing2D\MatrixTests.cs (5)
119using Matrix matrix = new(rect, plgpnts.Select(p => (PointF)p).ToArray()); 720PointF[] pointFs = points.Select(p => (PointF)p).ToArray(); 722Assert.Equal(expectedPoints.Select(p => (PointF)p), pointFs); 775PointF[] pointFs = points.Select(p => (PointF)p).ToArray(); 777Assert.Equal(expectedPoints.Select(p => (PointF)p), pointFs);
System\Drawing\FontConverterTests.cs (1)
193return installedFonts.Families.Select(t => t.Name).Contains(string.Empty);
System\Drawing\ImageTests.cs (1)
656paramList.Param.Select(p => p.Encoder.Guid));
System.IO.IsolatedStorage (2)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (2)
177return Directory.EnumerateFiles(RootDirectory, searchPattern).Select(f => Path.GetFileName(f)).ToArray(); 201return Directory.EnumerateDirectories(RootDirectory, searchPattern).Select(m => m.Substring(Path.GetDirectoryName(m)!.Length + 1)).ToArray();
System.Linq.Expressions (1)
System\Dynamic\Utils\TypeUtils.cs (1)
17.Select(i => i.GetGenericTypeDefinition())
System.Linq.Parallel (1)
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (1)
76return Child.AsSequentialQuery(token).Select(_selector);
System.Linq.Queryable (5)
System\Linq\EnumerableRewriter.cs (5)
177.Select(i => new { Info = i, GenType = i.GetGenericTypeDefinition() }) 181.Select(i => i.Info.GenericTypeArguments[0]) 190.Select(i => i.Info.GenericTypeArguments[0]) 224.Select(ApplyTypeArgs) 248ParameterInfo[][] parameters = matchingMethods.Select(m => m.GetParameters()).ToArray();
System.Private.Windows.Core (1)
System\DisposalTracking.cs (1)
72friendlyName += $"<{string.Join(",", type.GetGenericArguments().Select(GetFriendlyTypeName))}>";
System.Private.Windows.Core.TestUtilities (7)
TestAccessor.cs (2)
66Type[] types = invokeMethodInfo is null ? [] : invokeMethodInfo.GetParameters().Select(pi => pi.ParameterType).ToArray(); 118args.Select(a => a!.GetType()).ToArray(),
XUnit\EnumerableTupleTheoryData.cs (2)
22_data.Select(i => new object[] { i.Item1, i.Item2 }).GetEnumerator(); 40_data.Select(i => new object[] { i.Item1, i.Item2, i.Item3 }).GetEnumerator();
XUnit\ReadOnlyTheoryData.cs (3)
23=> _data = data.Cast<object>().Select(i => new object?[] { i }).ToArray(); 26=> _data = data.Select(i => new object?[] { i }).ToArray(); 29=> _data = data.Select(i => new object?[] { i }).ToArray();
System.Reflection.DispatchProxy (1)
System\Reflection\DispatchProxyGenerator.cs (1)
388PropertyBuilder pb = _tb.DefineProperty(pi.Name, pi.Attributes, pi.PropertyType, pi.GetIndexParameters().Select(p => p.ParameterType).ToArray());
System.Text.Json.SourceGeneration (2)
Helpers\SourceGeneratorHelpers.cs (2)
16.Select(name => name.Trim()) 17.Select(name =>
System.Text.RegularExpressions.Generator (4)
RegexGenerator.Emitter.cs (3)
560helperName = $"IndexOfAny{(negatedCategory ? "Except" : "")}{string.Concat(categories.Slice(0, numCategories).ToArray().Select(c => c.ToString()))}"; 593lines.AddRange(additionalDeclarations.Select(s => $" {s}")); 1811writer.WriteLine($"case {string.Join(" or ", setChars.Slice(0, numChars).ToArray().Select(Literal))}:");
UpgradeToGeneratedRegexCodeFixer.cs (1)
167.Select(arg => arg.Syntax);
System.Threading.Tasks.Dataflow (2)
Internal\DataflowEtwProvider.cs (1)
143try { exceptionData = string.Join(Environment.NewLine, completionTask.Exception!.InnerExceptions.Select(static e => e.ToString())); }
Internal\TargetCore.cs (1)
856internal IEnumerable<TInput> InputQueue { get { return _target._messages.Select(static kvp => kvp.Key).ToList(); } }
System.Windows.Forms (5)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.PropertyTabCollection.cs (2)
101_ownerPropertyGrid._tabs.Select(i => i.Tab).ToArray(), 119return _ownerPropertyGrid._tabs.Select(i => i.Tab).GetEnumerator();
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogPage.cs (3)
874.Select(e => new KeyValuePair<int, TaskDialogButton>(e.ButtonID, e))); 924customButtonElements = _boundCustomButtons.Where(e => e.IsCreated).Select(e => (e.ButtonID, e.GetResultingText()!)); 925radioButtonElements = radioButtons.Where(e => e.IsCreated).Select(e => (e.RadioButtonID, e.Text!));
System.Windows.Forms.Design (1)
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (1)
390: string.Join(", ", argArray.Select(o => o?.GetType().Name ?? "null"));
System.Windows.Forms.Design.Tests (18)
CodeDomHelpers.cs (1)
70string parameters = string.Join(", ", coce.Parameters.Cast<CodeObject>().Select(GetConstructionString));
System\Drawing\Design\ToolboxItemTests.cs (6)
1366Assert.Equal(new string[] { type.Assembly.FullName }, item.DependentAssemblies.Select(a => a.FullName)); 1368Assert.Equal(new string[] { type.Name, "Filter", "System.Drawing.Design.Tests.ToolboxItemTests+" + type.Name }, item.Filter.Cast<ToolboxItemFilterAttribute>().Select(a => a.FilterString).OrderBy(f => f)); 1374Assert.Equal(new string[] { type.Assembly.FullName }, item.DependentAssemblies.Select(a => a.FullName)); 1376Assert.Equal(new string[] { type.Name, "Filter", "System.Drawing.Design.Tests.ToolboxItemTests+" + type.Name }, item.Filter.Cast<ToolboxItemFilterAttribute>().Select(a => a.FilterString).OrderBy(f => f)); 1403Assert.Equal(new string[] { typeof(object).Assembly.FullName }, item.DependentAssemblies.Select(a => a.FullName)); 1405Assert.Equal(new string[] { "System.Object" }, item.Filter.Cast<ToolboxItemFilterAttribute>().Select(a => a.FilterString));
System\Windows\Forms\Design\ContextMenuStripActionListTests.cs (6)
115items.Select(item => item.MemberName) 118items.Select(item => item.DisplayName) 121items.Select(item => item.Description) 130items.Select(item => item.MemberName) 135items.Select(item => item.DisplayName) 149items.Select(item => item.MemberName)
System\Windows\Forms\Design\WindowsFormsDesignerOptionServiceTests.cs (5)
36Assert.Equal(new string[] { "EnableInSituEditing", "GridSize", "ObjectBoundSmartTagAutoShow", "ShowGrid", "SnapToGrid", "UseOptimizedCodeGeneration", "UseSmartTags", "UseSnapLines" }, childCollection.Properties.Sort().Cast<PropertyDescriptor>().Select(p => p.Name)); 60Assert.Equal(new string[] { "EnableInSituEditing", "GridSize", "ObjectBoundSmartTagAutoShow", "ShowGrid", "SnapToGrid", "UseOptimizedCodeGeneration", "UseSmartTags", "UseSnapLines" }, childCollection.Properties.Sort().Cast<PropertyDescriptor>().Select(p => p.Name)); 77Assert.Equal(new string[] { "EnableInSituEditing", "GridSize", "ObjectBoundSmartTagAutoShow", "ShowGrid", "SnapToGrid", "UseOptimizedCodeGeneration", "UseSmartTags", "UseSnapLines" }, childCollection.Properties.Sort().Cast<PropertyDescriptor>().Select(p => p.Name)); 84Assert.Equal(new string[] { "EnableInSituEditing", "GridSize", "ObjectBoundSmartTagAutoShow", "ShowGrid", "SnapToGrid", "UseOptimizedCodeGeneration", "UseSmartTags", "UseSnapLines" }, childCollection.Properties.Sort().Cast<PropertyDescriptor>().Select(p => p.Name)); 100Assert.Equal(new string[] { "EnableInSituEditing", "GridSize", "ObjectBoundSmartTagAutoShow", "ShowGrid", "SnapToGrid", "UseOptimizedCodeGeneration", "UseSmartTags", "UseSnapLines" }, childCollection.Properties.Sort().Cast<PropertyDescriptor>().Select(p => p.Name));
System.Windows.Forms.Primitives.TestUtilities (1)
SystemCOLORs.cs (1)
51string colorString = string.Join(", ", colors.Select(c => s_names[c]));
System.Windows.Forms.Tests (27)
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (1)
1236return ReflectionHelper.GetPublicNotAbstractClasses<Control>().Select(type => new object[] { type });
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (1)
1751listView.Items.AddRange(Enumerable.Range(0, 11).Select(i => new ListViewItem()).ToArray());
System\Windows\Forms\AccessibleObjects\ToolStripControlHost.ToolStripHostedControlAccessibleObjectTests.cs (1)
13return ReflectionHelper.GetPublicNotAbstractClasses<ToolStripControlHost>().Select(type => new object[] { type });
System\Windows\Forms\AccessibleObjects\ToolStripDropDownMenu.ToolStripDropDownMenuAccessibleObjectTests.cs (3)
12IEnumerable<Type> types = ReflectionHelper.GetPublicNotAbstractClasses<ToolStripDropDownItem>().Select(type => type); 79IEnumerable<Type> types = ReflectionHelper.GetPublicNotAbstractClasses<ToolStripDropDownItem>().Select(type => type); 171IEnumerable<Type> types = ReflectionHelper.GetPublicNotAbstractClasses<ToolStripDropDownItem>().Select(type => type);
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (1)
44return ReflectionHelper.GetPublicNotAbstractClasses<ToolStripItem>().Select(type => new object[] { type });
System\Windows\Forms\AccessibleObjects\ToolStripScrollButton.ToolStripScrollButtonAccessibleObjectTests.cs (1)
12IEnumerable<Type> types = ReflectionHelper.GetPublicNotAbstractClasses<ToolStripDropDownItem>().Select(type => type);
System\Windows\Forms\AccessibleObjects\TreeView.TreeViewAccessibleObjectTests.cs (1)
277control.Nodes.AddRange(nodeNames.Select(name => new TreeNode(name)).ToArray());
System\Windows\Forms\AxWebBrowserTests.cs (2)
42.Select(prop => prop.Name) 48.Select(ev => ev.Name)
System\Windows\Forms\ListBindingHelperTests.cs (9)
292Assert.Equal(expected, properties?.Select(p => p.Name)); 296Assert.Equal(expected, properties?.Select(p => p.Name)); 300Assert.Equal(expected, properties?.Select(p => p.Name)); 304Assert.Equal(expected, properties?.Select(p => p.Name)); 308Assert.Equal(expected, properties?.Select(p => p.Name)); 410Assert.Equal(expected, properties?.Select(p => p.Name)); 414Assert.Equal(expected, properties?.Select(p => p.Name)); 418Assert.Equal(expected, properties?.Select(p => p.Name)); 436Assert.Equal(expected, properties?.Select(p => p.Name));
System\Windows\Forms\ListViewGroupTests.cs (2)
1350Assert.Equal(group.Items.Cast<ListViewItem>().Select(i => i.Text), result.Items.Cast<ListViewItem>().Select(i => i.Text));
System\Windows\Forms\ListViewItemTests.cs (1)
1050AssertEqualListViewSubItem(expected?.Select(t => new ListViewItem.ListViewSubItem(null, t)).ToArray(), actual);
System\Windows\Forms\TabControlTests.cs (2)
2134Assert.Equal(expectedVisible, control.TabPages.Cast<TabPage>().Select(p => p.Visible)); 2143Assert.Equal(expectedVisible, control.TabPages.Cast<TabPage>().Select(p => p.Visible));
System\Windows\Forms\ToolStripItemCollectionTests.cs (2)
154items.Select(item => new ToolStripButton(item.Name) { Name = item.Key }).ToArray(); 172ToolStripItem[] toolStripItems = items.Select(item => new ToolStripButton(item.Name) { Name = item.Key }).ToArray();
System.Windows.Forms.UI.IntegrationTests (2)
Infra\DataCollectionService.cs (2)
234string sanitizedTestName = new(testName.Select(c => char.IsLetterOrDigit(c) ? c : '_').ToArray()); 235string sanitizedErrorId = new(errorId.Select(c => char.IsLetterOrDigit(c) ? c : '_').ToArray());
System.Xaml.Tests (2)
System\Windows\Markup\StaticExtensionTests.cs (1)
217Assert.Equal(new Type[] { typeof(string) }, Assert.IsAssignableFrom<ConstructorInfo>(descriptor.MemberInfo).GetParameters().Select(p => p.ParameterType));
System\Windows\Markup\TypeExtensionTests.cs (1)
178Assert.Equal(new Type[] { typeof(Type) }, Assert.IsAssignableFrom<ConstructorInfo>(descriptor.MemberInfo).GetParameters().Select(p => p.ParameterType));
Templates.Blazor.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
299var hashes = matches.OfType<Match>().Select(m => m.Groups[1].Value).ToList();
Templates.Blazor.WebAssembly.Auth.Tests (2)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
299var hashes = matches.OfType<Match>().Select(m => m.Groups[1].Value).ToList();
src\Shared\E2ETesting\WaitAssert.cs (1)
123var errors = driver.GetBrowserLogs(LogLevel.All).Select(c => c.ToString()).ToList();
Templates.Blazor.WebAssembly.Tests (2)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
299var hashes = matches.OfType<Match>().Select(m => m.Groups[1].Value).ToList();
src\Shared\E2ETesting\WaitAssert.cs (1)
123var errors = driver.GetBrowserLogs(LogLevel.All).Select(c => c.ToString()).ToList();
Templates.Mvc.Tests (2)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
299var hashes = matches.OfType<Match>().Select(m => m.Groups[1].Value).ToList();
src\Shared\E2ETesting\WaitAssert.cs (1)
123var errors = driver.GetBrowserLogs(LogLevel.All).Select(c => c.ToString()).ToList();
Templates.Tests (4)
BaselineTest.cs (2)
47((JArray)scenarioName.Value["Files"]).Select(s => (string)s).ToArray()); 80expectedFiles = expectedFiles.Select(f => f.Replace("{ProjectName}", Project.ProjectName)).ToArray();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
299var hashes = matches.OfType<Match>().Select(m => m.Groups[1].Value).ToList();
src\Shared\E2ETesting\WaitAssert.cs (1)
123var errors = driver.GetBrowserLogs(LogLevel.All).Select(c => c.ToString()).ToList();
TestingAppHost1.MyWebApp (1)
Program.cs (1)
25var forecast = Enumerable.Range(1, 5).Select(index =>
vbc (1)
src\Compilers\Shared\BuildClient.cs (1)
129var args = originalArguments.Select(arg => arg.Trim()).ToArray();
VBCSCompiler (1)
src\Compilers\Shared\BuildClient.cs (1)
129var args = originalArguments.Select(arg => arg.Trim()).ToArray();
VBCSCompiler.UnitTests (2)
TouchedFileLoggingTests.cs (2)
186var expected = expectedReads.Select(s => s.ToUpperInvariant()).OrderBy(s => s); 190expected = expectedWrites.Select(s => s.ToUpperInvariant()).OrderBy(s => s);
Wasm.Performance.TestApp (1)
Person.cs (1)
29.Select(index => GenerateOrgChart(totalDepth, numDescendantsPerNode, thisDepth + 1, name, index))
WsFedSample (1)
Startup.cs (1)
124await WriteTableHeader(response, new string[] { "Claim Type", "Value" }, context.User.Claims.Select(c => new string[] { c.Type, c.Value }));
XmlFormattersWebSite (3)
Controllers\HomeController.cs (1)
40errors.Select(modelError => $"ErrorMessage:{modelError.ErrorMessage};Exception:{modelError.Exception}")));
Controllers\IQueryableController.cs (2)
13return Enumerable.Range(1, 2).Select(i => i * 10).AsQueryable(); 18return Enumerable.Range(1, 2).Select(i => "value" + i).AsQueryable();
xunit.assert (12)
EqualityAsserts.cs (2)
320 var expectedInterfaceTypeDefinitions = expectedType?.GetTypeInfo().ImplementedInterfaces.Where(i => i.GetTypeInfo().IsGenericType).Select(i => i.GetGenericTypeDefinition()); 323 var actualInterfaceTypeDefinitions = actualType?.GetTypeInfo().ImplementedInterfaces.Where(i => i.GetTypeInfo().IsGenericType).Select(i => i.GetGenericTypeDefinition());
Sdk\ArgumentFormatter.cs (5)
267 : string.Format(CultureInfo.CurrentCulture, "Task<{0}>", string.Join(",", typeParameters.Select(t => FormatTypeName(t)))); 337 .Select(f => new { name = f.Name, value = WrapAndGetFormattedValue(() => f.GetValue(value), depth) }); 343 .Select(p => new { name = p.Name, value = WrapAndGetFormattedValue(() => p.GetValue(value), depth) }); 355 var formattedParameters = string.Join(", ", parameters.Take(MAX_OBJECT_ITEM_COUNT).Select(p => string.Format(CultureInfo.CurrentCulture, "{0} = {1}", p.name, p.value))); 532 result = string.Format(CultureInfo.CurrentCulture, "{0}<{1}>", result, string.Join(", ", typeInfo.GenericTypeArguments.Select(t => FormatTypeName(t))));
Sdk\AssertHelper.cs (2)
143 .Select(f => new { name = f.Name, getter = (Func<object?, object?>)f.GetValue }); 161 .Select(p => new { name = p.Name, getter = (Func<object?, object?>)p.GetValue });
Sdk\Exceptions\AllException.cs (1)
60 errors.Select(error =>
Sdk\Exceptions\EquivalentException.cs (1)
47 string.Join(", ", memberNames.Select(k => string.Format(CultureInfo.CurrentCulture, "\"{0}{1}\"", prefix, k)))
Sdk\Exceptions\ExceptionUtility.cs (1)
95 .Select(frame => TransformStackFrame(frame, indent))
xunit.console (23)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (14)
57internalDiagnosticsMessageSink.OnMessage(new _DiagnosticMessage($"[DependencyContextAssemblyCache..ctor] Runtime graph: [{string.Join(",", dependencyContext.RuntimeGraph.Select(x => $"'{x.Runtime}'"))}]")); 62internalDiagnosticsMessageSink.OnMessage(new _DiagnosticMessage($"[DependencyContextAssemblyCache..ctor] Compatible runtimes: [{string.Join(",", compatibleRuntimes.Select(x => $"'{x}'"))}]")); 68.Select(lib => compatibleRuntimes.Select(runtime => Tuple.Create(lib, lib.RuntimeAssemblyGroups.FirstOrDefault(libGroup => string.Equals(libGroup.Runtime, runtime)))) 72.Select(path => Tuple.Create(Path.GetFileNameWithoutExtension(path), Tuple.Create(tuple.Item1, tuple.Item2)))) 76internalDiagnosticsMessageSink.OnMessage(new _DiagnosticMessage($"[DependencyContextAssemblyCache..ctor] Managed assembly map: [{string.Join(",", managedAssemblyMap.Keys.Select(k => $"'{k}'").OrderBy(k => k, StringComparer.OrdinalIgnoreCase))}]")); 82.Select(lib => compatibleRuntimes.Select(runtime => Tuple.Create(lib, lib.NativeLibraryGroups.FirstOrDefault(libGroup => string.Equals(libGroup.Runtime, runtime)))) 86.Select(path => Tuple.Create(Path.GetFileName(path), Tuple.Create(tuple.Item1, tuple.Item2)))) 90internalDiagnosticsMessageSink.OnMessage(new _DiagnosticMessage($"[DependencyContextAssemblyCache..ctor] Unmanaged assembly map: [{string.Join(",", unmanagedAssemblyMap.Keys.Select(k => $"'{k}'").OrderBy(k => k, StringComparer.OrdinalIgnoreCase))}]")); 253internalDiagnosticsMessageSink.OnMessage(new _DiagnosticMessage($"[DependencyContextAssemblyCache.ResolveManagedAssembly] Resolving '{assemblyName}', found a resolved path, but could not map a filename in [{string.Join(",", assemblies.OrderBy(k => k, StringComparer.OrdinalIgnoreCase).Select(k => $"'{k}'"))}]")); 259internalDiagnosticsMessageSink.OnMessage(new _DiagnosticMessage($"[DependencyContextAssemblyCache.ResolveManagedAssembly] Resolving '{assemblyName}', found in dependency map, but unable to resolve a path in [{string.Join(",", assetGroup.AssetPaths.OrderBy(k => k, StringComparer.OrdinalIgnoreCase).Select(k => $"'{k}'"))}]")); 286internalDiagnosticsMessageSink.OnMessage(new _DiagnosticMessage($"[DependencyContextAssemblyCache.ResolveUnmanagedLibrary] Found a resolved path, but could not map a filename in [{string.Join(",", assemblies.OrderBy(k => k, StringComparer.OrdinalIgnoreCase).Select(k => $"'{k}'"))}]")); 291internalDiagnosticsMessageSink.OnMessage(new _DiagnosticMessage($"[DependencyContextAssemblyCache.ResolveUnmanagedLibrary] Found in dependency map, but unable to resolve a path in [{string.Join(",", assetGroup.AssetPaths.OrderBy(k => k, StringComparer.OrdinalIgnoreCase).Select(k => $"'{k}'"))}]"));
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextJsonReader.cs (3)
359return libraries.Select(property => CreateLibrary(property, runtime, libraryStubs)) 395.Select(e => e.Path) 407.Select(e => e.Path)
common\AssemblyResolution\XunitPackageCompilationAssemblyResolver.cs (1)
59internalDiagnosticsMessageSink.OnMessage(new _DiagnosticMessage($"[XunitPackageCompilationAssemblyResolver.GetDefaultProbeDirectories] returns: [{string.Join(",", results.Select(x => $"'{x}'"))}]"));
ConsoleRunner.cs (4)
138foreach (var dllFile in Directory.GetFiles(runnerPath, "*.dll").Select(f => Path.Combine(runnerPath, f))) 288var tasks = project.Assemblies.Select(assembly => Task.Run(() => ExecuteAssembly(consoleLock, assembly, serialize, needsXml, parallelizeTestCollections, maxThreadCount, diagnosticMessages, noColor, appDomains, failSkips, stopOnFail, project.Filters, internalDiagnosticMessages))); 388filteredTestCases = filteredTestCases.Select(controller.Serialize).Select(controller.Deserialize).ToList();
Utility\TransformFactory.cs (1)
61.Select(output => new Action<XElement>(xml => instance.availableTransforms[output.Key].OutputHandler(xml, output.Value)))