3017 references to Where
AnalyzerRunner (6)
CodeRefactoringRunner.cs (1)
234language => refactorings.Where(refactoring => refactoring.Metadata.Languages.Contains(language)).ToImmutableArray());
DiagnosticAnalyzerRunner.cs (3)
87var allDiagnostics = analysisResult.Where(pair => pair.Value != null).SelectManyAsArray(pair => pair.Value.GetAllDiagnostics()); 126var sumOfDocumentAverages = documentPerformance.Where(x => x.Key.ProjectId == projectId).Sum(x => x.Value.EditsPerSecond); 127double documentCount = documentPerformance.Where(x => x.Key.ProjectId == projectId).Count();
Program.cs (2)
145var projects = solution.Projects.Where(project => project.Language is LanguageNames.CSharp or LanguageNames.VisualBasic).ToList(); 176var projects = solution.Projects.Where(project => project.Language is LanguageNames.CSharp or LanguageNames.VisualBasic).ToList();
Aspire.Dashboard (16)
Authentication\AspirePolicyEvaluator.cs (1)
145newPrincipal.AddIdentities(existingPrincipal.Identities.Where(i => i.IsAuthenticated || i.Claims.Any()));
Components\Controls\Chart\MetricTable.razor.cs (1)
214addedXValues = newMetrics.Keys.Where(newKey => newKey > latestCurrentMetric || latestCurrentMetric == null).ToHashSet();
Components\Pages\ConsoleLogs.razor.cs (1)
240.Where(r => !r.Value.IsHiddenState())
DashboardWebApplication.cs (1)
445.Where(culture => LocalizedCultures.Contains(culture.TwoLetterISOLanguageName) || LocalizedCultures.Contains(culture.Name))
Extensions\TelemetryFilterFormatter.cs (1)
87.Where(filter => filter is not null)
Model\Otlp\TelemetryFilter.cs (4)
107return input.Where(x => func(x.TimeStamp, date)); 114return input.Where(x => func((int)x.Severity, (double)value)); 121return input.Where(x => func(x.Message, Value)); 126return input.Where(x => func(OtlpLogEntry.GetFieldValue(x, Field), Value));
Model\ResourceGridViewModel.cs (1)
46foreach (var gridVM in initialGridVMs.Where(r => !HasParent(r)))
Otlp\Storage\TelemetryRepository.cs (6)
97results = results.Where(a => string.Equals(a.ApplicationKey.Name, name, StringComparisons.ResourceName)); 401results = results.Where(l => MatchApplications(l.ApplicationView.Application, applications)); 444applicationKeys = applicationKeys.Where(keys => MatchApplications(keys.Application, applications)); 471applicationKeys = applicationKeys.Where(keys => MatchApplications(keys.Application, applications)); 507results = results.Where(t => 646var results = _traces.Where(t => t.TraceId.StartsWith(traceId, StringComparison.Ordinal));
Aspire.Dashboard.Components.Tests (1)
Controls\StructuredLogDetailsTests.cs (1)
69var duplicate = properties.GroupBy(p => p.Key).Where(g => g.Count() >= 2).FirstOrDefault();
Aspire.Dashboard.Tests (13)
AssemblyExtensionsTests.cs (1)
91return _customAttributes.Where(a => a.GetType() == attributeType).ToArray();
Integration\FrontendBrowserTokenAuthTests.cs (4)
171var l = testSink.Writes.Where(w => w.LoggerName == typeof(DashboardWebApplication).FullName).ToList(); 232var l = testSink.Writes.Where(w => w.LoggerName == typeof(DashboardWebApplication).FullName).ToList(); 259var l = testSink.Writes.Where(w => w.LoggerName == typeof(DashboardWebApplication).FullName).ToList(); 262Assert.Single(l.Where(w => "Login to the dashboard at {DashboardLoginUrl}. The URL may need changes depending on how network access to the container is configured." == (string?)GetValue(w.State, "{OriginalFormat}")));
Integration\StartupTests.cs (8)
499Assert.Single(options.Value.Rules.Where(r => r.CategoryName == null && r.LogLevel == LogLevel.Trace)); 500Assert.Single(options.Value.Rules.Where(r => r.CategoryName == "Grpc" && r.LogLevel == LogLevel.Trace)); 501Assert.Single(options.Value.Rules.Where(r => r.CategoryName == "Microsoft.Hosting.Lifetime" && r.LogLevel == LogLevel.Trace)); 538Assert.Single(options.Value.Rules.Where(r => r.CategoryName == null && r.LogLevel == LogLevel.Trace)); 539Assert.Single(options.Value.Rules.Where(r => r.CategoryName == "Grpc" && r.LogLevel == LogLevel.Trace)); 540Assert.Single(options.Value.Rules.Where(r => r.CategoryName == "Microsoft.Hosting.Lifetime" && r.LogLevel == LogLevel.Trace)); 559var l = testSink.Writes.Where(w => w.LoggerName == typeof(DashboardWebApplication).FullName).ToList(); 639var l = testSink.Writes.Where(w => w.LoggerName == typeof(DashboardWebApplication).FullName).ToList();
Aspire.EndToEnd.Tests (3)
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (2)
55installTemplates = packageIdAndPaths.Where(t => new FileInfo(t.path).LastWriteTimeUtc > dirWriteTime).Any(); 87.Where(p => packageNameRegex.IsMatch(Path.GetFileName(p)));
tests\testproject\Common\TestResourceNames.cs (1)
40.Where(ename => ename != TestResourceNames.None && resourceNames.HasFlag(ename)));
Aspire.Hosting (5)
DistributedApplicationBuilder.cs (1)
404.Where(g => g.Count() > 1)
Publishing\ManifestPublishingContext.cs (2)
589var bindMounts = mounts.Where(mounts => mounts.Type == ContainerMountType.BindMount).ToList(); 615var volumes = mounts.Where(mounts => mounts.Type == ContainerMountType.Volume).ToList();
ResourceBuilderExtensions.cs (1)
479.Where(ea => StringComparers.EndpointAnnotationName.Equals(ea.Name, endpointName))
src\Shared\SecretsStore.cs (1)
91.Where(i => i.Value != null)
Aspire.Hosting.Analyzers (2)
AppHostAnalyzer.cs (2)
83.Where(parameterData => 115return modelTypes.Where(m => m is not null).Select(m => m.Value).ToArray();
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppsInfrastructure.cs (3)
261var unsupportedEndpoints = endpoints.Where(e => e.UriScheme is not ("tcp" or "http" or "https")).ToArray(); 383var httpOnlyEndpoints = endpointsByTargetPort.Where(g => g.IsHttpOnly).OrderBy(g => g.Index).ToArray(); 391var externalHttp = httpOnlyEndpoints.Where(g => g.External).ToArray();
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
365.Where(component => component.Options?.LocalPath is null)
Aspire.Hosting.MySql.Tests (1)
AddMySqlTests.cs (1)
230Assert.Single(builder.Resources.OfType<ContainerResource>().Where(resource => resource.Name is "mySql-phpmyadmin"));
Aspire.Hosting.RabbitMQ.Tests (2)
AddRabbitMQTests.cs (2)
56var primaryEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>().Where(e => e.Name == "tcp")); 67var mangementEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>().Where(e => e.Name == "management"));
Aspire.Hosting.Testing.Tests (1)
tests\testproject\Common\TestResourceNames.cs (1)
40.Where(ename => ename != TestResourceNames.None && resourceNames.HasFlag(ename)));
Aspire.Hosting.Tests (15)
Dashboard\DashboardResourceTests.cs (3)
313var container = Assert.Single(model.Resources.Where(r => r.Name == "my-container")); 317var dashboard = Assert.Single(model.Resources.Where(r => r.Name == "aspire-dashboard")); 355var dashboard = Assert.Single(model.Resources.Where(r => r.Name == "aspire-dashboard"));
DcpVisibilityTests.cs (1)
14var dcpNamespaceTypes = types.Where(t => t.FullName!.Contains("Dcp", StringComparison.OrdinalIgnoreCase));
DistributedApplicationTests.cs (2)
140var lifecycleHookDescriptors = testProgram.AppBuilder.Services.Where(sd => sd.ServiceType == typeof(IDistributedApplicationLifecycleHook)); 142Assert.Single(lifecycleHookDescriptors.Where(sd => sd.ImplementationFactory == callback1));
KestrelConfigTests.cs (1)
147config.Where(envVar => envVar.Key.StartsWith("Kestrel__")),
ResourceNotificationTests.cs (4)
307Assert.Single(logs.Where(l => l.Level == LogLevel.Debug)); 327Assert.Single(logs.Where(l => l.Level == LogLevel.Debug)); 377Assert.Single(logs.Where(l => l.Level == LogLevel.Debug)); 378Assert.Equal(3, logs.Where(l => l.Level == LogLevel.Trace).Count());
Schema\SchemaTests.cs (1)
751var errorMessages = results.Details.Where(x => x.HasErrors).SelectMany(e => e.Errors!).Select(e => e.Value);
WithEndpointTests.cs (3)
30.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single(); 47.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single(); 82.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single();
Aspire.Playground.Tests (7)
AppHostTests.cs (1)
310.Where(fileName => !fileName.EndsWith("Aspire.Hosting.AppHost.dll", StringComparison.OrdinalIgnoreCase));
Infrastructure\DistributedApplicationExtensions.cs (6)
28var parameters = builder.Resources.OfType<ParameterResource>().Where(p => !p.IsConnectionString).ToList(); 54.Where(m => m.Type == ContainerMountType.Volume && !string.IsNullOrEmpty(m.Source)) 116var appHostLogs = logs.Where(l => l.Category?.StartsWith($"{environment.ApplicationName}.Resources") == false).ToList(); 117var resourceLogs = logs.Where(l => l.Category?.StartsWith($"{environment.ApplicationName}.Resources") == true).ToList(); 133var assertableResourceLogNames = applicationModel.Resources.Where(ShouldAssertErrorsForResource).Select(r => $"{environment.ApplicationName}.Resources.{r.Name}").ToList(); 240var dbContextTypes = projectAssembly.GetTypes().Where(DerivesFromDbContext);
Aspire.Workload.Tests (3)
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (2)
55installTemplates = packageIdAndPaths.Where(t => new FileInfo(t.path).LastWriteTimeUtc > dirWriteTime).Any(); 87.Where(p => packageNameRegex.IsMatch(Path.GetFileName(p)));
WorkloadTestsBase.cs (1)
228string[] matchedEndpoints = expectedEndpoints.Where(e => Regex.IsMatch(endpointFound, e)).ToArray();
BasicWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
31.Where(kvp => kvp.Key != "link" && kvp.Key != "link_action" && kvp.Key != "link_controller")
BoundTreeGenerator (9)
BoundNodeClassWriter.cs (9)
41_typeMap = tree.Types.Where(t => t is not (EnumType or ValueType)).ToDictionary(n => n.Name, n => n.Base); 50foreach (ValueType t in _tree.Types.Where(t => t is ValueType)) 278foreach (var node in _tree.Types.Where(n => n is not PredefinedNode)) 662IEnumerable<Field> nullCheckFields = AllFields(node).Where(f => FieldNullHandling(node, f.Name) == NullHandling.Disallow); 759return AllFields(node).Where(field => IsDerivedOrListOfDerived("BoundNode", field.Type)); 764return AllFields(node).Where(field => TypeIsTypeSymbol(field)); 769return AllFields(node).Where(field => TypeIsSymbol(field) || (IsImmutableArray(field.Type, out var elementType) && TypeIsSymbol(elementType))); 1179var fields = AllFields(node).Where(f => IsDerivedOrListOfDerived("BoundNode", f.Type) && !SkipInVisitor(f)); 1209foreach (Field field in AllFields(node).Where(f => IsDerivedOrListOfDerived("BoundNode", f.Type) && !SkipInVisitor(f)))
BuildActionTelemetryTable (2)
Program.cs (2)
481assembly => assembly.GetTypes().Where( 485.Where(t => isCodeActionType(t) || isCodeActionProviderType(t))
BuildBoss (6)
CompilerNuGetCheckerUtil.cs (4)
245.Where(IsTrackedAsset); 345.Where(x => x.RelativeName.StartsWith(folderRelativePath, PathComparison)) 408.Where(x => x.StartsWith("Microsoft.CodeAnalysis")) 426.Where(filePath =>
ProjectUtil.cs (1)
108.Where(x => !string.IsNullOrEmpty(x));
SolutionCheckerUtil.cs (1)
125foreach (var data in dataList.Where(x => x.ProjectEntry.ProjectType != ProjectFileType.Tool))
BuildValidator (5)
Program.cs (5)
262foreach (var diff in assembliesCompiled.Where(a => a.Result == RebuildResult.Success)) 270foreach (var diff in assembliesCompiled.Where(a => a.Result == RebuildResult.BinaryDifference)) 279foreach (var diff in assembliesCompiled.Where(a => a.Result == RebuildResult.CompilationError)) 288foreach (var diff in assembliesCompiled.Where(a => a.Result == RebuildResult.MissingReferences)) 297foreach (var diff in assembliesCompiled.Where(a => a.Result == RebuildResult.MiscError))
ClientSample (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
CodeGenerator (24)
FeatureCollectionGenerator.cs (3)
35internal protected {feature}? _current{feature};")}{(allFeatures.Where(f => !implementedFeatures.Contains(f)).FirstOrDefault() is not null ? @" 37// Other reserved feature slots" : "")}{Each(allFeatures.Where(f => !implementedFeatures.Contains(f)), feature => $@" 47{Each(allFeatures.Where(f => !implementedFeatures.Contains(f)), feature => $@"
HttpUtilities\HttpUtilities.cs (1)
38var methodsInfoWithoutGet = methodsInfo.Where(m => m.HttpMethod != "Get").ToList();
src\Servers\Kestrel\shared\KnownHeaders.cs (20)
39.Where(h => h.GetCustomAttribute(typeof(ObsoleteAttribute)) == null) 298.Where(header => invalidH2H3ResponseHeaders.Contains(header.Name)) 303.Where(header => FormattedInternalHeaderNames.Where(x => x.IsPseudoHeader).Select(x => x.Identifier).Contains(header.Identifier)) 810foreach (var loop in loops.Where(l => l.Bytes != null)) 864{Each(loop.Headers.Where(header => header.ExistenceCheck), header => $@" 866{Each(loop.Headers.Where(header => header.FastCount), header => $@" 868{Each(loop.Headers.Where(header => Array.IndexOf(InternalHeaderAccessors, header.Name) >= 0), header => $@" 906{Each(loop.Headers.Where(header => header.Name != HeaderNames.ContentLength && !NonApiHeaders.Contains(header.Identifier)), header => $@" 937{Each(ApiHeaderNames.Where(header => header != "ContentLength" && !loop.Headers.Select(kh => kh.Identifier).Contains(header)), header => $@" 956{Each(loop.Headers.Where(header => header.EnhancedSetter), header => $@" 1152{Each(loop.Headers.Where(header => header.Identifier != "ContentLength").OrderBy(h => !h.PrimaryHeader), header => $@" 1168{Each(loop.Headers.Where(header => header.Identifier != "ContentLength").OrderBy(h => !h.PrimaryHeader), header => $@" 1187{Each(loop.Headers.Where(header => header.Identifier != "ContentLength"), header => $@" 1240{{{Each(loop.Headers.OrderBy(h => h.Index).Where(h => h.Identifier != "ContentLength"), header => $@" 1384{{{Each(loop.Headers.Where(header => header.Identifier != "ContentLength"), header => @" 1386{Each(loop.Headers.Where(header => header.EnhancedSetter), header => @" 1396{{{Each(loop.Headers.Where(header => header.Identifier != "ContentLength"), header => $@" 1511}).Where(g => g.Header != null).ToList(); 1532}).Where(g => g.Header != null).ToList();
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (1)
48return infoList?.Where(i => i.Interceptor == interceptor);
CSharpSyntaxGenerator (45)
SignatureWriter.cs (3)
51var nodes = _tree.Types.Where(n => n is not PredefinedNode).ToList(); 85var valueFields = nd.Fields.Where(n => !IsNodeOrNodeList(n.Type)).ToList(); 86var nodeFields = nd.Fields.Where(n => IsNodeOrNodeList(n.Type)).ToList();
SourceWriter.cs (31)
76var nodes = Tree.Types.Where(n => n is not PredefinedNode).ToList(); 114var valueFields = nd.Fields.Where(n => !IsNodeOrNodeList(n.Type)).ToList(); 115var nodeFields = nd.Fields.Where(n => IsNodeOrNodeList(n.Type)).ToList(); 153var valueFields = nd.Fields.Where(n => !IsNodeOrNodeList(n.Type)).ToList(); 154var nodeFields = nd.Fields.Where(n => IsNodeOrNodeList(n.Type)).ToList(); 366var nodes = Tree.Types.Where(n => n is not PredefinedNode).ToList(); 434var nodes = Tree.Types.Where(n => n is not PredefinedNode).ToList(); 442var nodeFields = node.Fields.Where(nd => IsNodeOrNodeList(nd.Type)).ToList(); 477var nodes = Tree.Types.Where(n => n is not PredefinedNode and not AbstractNode).ToList(); 494var nodes = Tree.Types.Where(n => n is not PredefinedNode and not AbstractNode).ToList(); 513var valueFields = nd.Fields.Where(n => !IsNodeOrNodeList(n.Type)).ToList(); 514var nodeFields = nd.Fields.Where(n => IsNodeOrNodeList(n.Type)).ToList(); 683var nodes = Tree.Types.Where(n => n is not PredefinedNode).ToList(); 693? an.Fields.Where(n => IsNodeOrNodeList(n.Type)).ToList() 695? nd.Fields.Where(n => IsNodeOrNodeList(n.Type)).ToList() 712var valueFields = nd.Fields.Where(n => !IsNodeOrNodeList(n.Type)).ToList(); 824var valueFields = nd.Fields.Where(n => !IsNodeOrNodeList(n.Type)).ToList(); 825var nodeFields = nd.Fields.Where(n => IsNodeOrNodeList(n.Type)).ToList(); 941.Where(t => t.field.Type is not "SyntaxToken" and not "SyntaxList<SyntaxToken>"); 987.Where(t => t.field.Type is not "SyntaxToken" and not "SyntaxList<SyntaxToken>"); 1061var nodes = Tree.Types.Where(n => n is not PredefinedNode).ToList(); 1286var nodes = Tree.Types.Where(n => n is not PredefinedNode).ToList(); 1332var nodes = Tree.Types.Where(n => n is not PredefinedNode and not AbstractNode).OfType<Node>().ToList(); 1419var valueFields = nd.Fields.Where(n => IsValueField(n)).ToList(); 1420var nodeFields = nd.Fields.Where(n => !IsValueField(n)).ToList(); 1589return nd.Fields.Where(f => !IsAutoCreatableToken(nd, f)); 1612nd.Fields.Where(factoryWithNoAutoCreatableTokenFields.Contains).Select( 1672return nd.Fields.Where(f => IsRequiredFactoryField(nd, f) || allowOptionalField == f); 1701nd.Fields.Where(minimalFactoryfields.Contains).Select(f => 1797foreach (var line in lines.Where(l => !string.IsNullOrWhiteSpace(l))) 1815foreach (string line in lines.Where(l => !string.IsNullOrWhiteSpace(l)))
TestWriter.cs (11)
82var nodes = Tree.Types.Where(n => n is not PredefinedNode and not AbstractNode); 97var valueFields = node.Fields.Where(n => !IsNodeOrNodeList(n.Type)); 98var nodeFields = node.Fields.Where(n => IsNodeOrNodeList(n.Type)); 214var nodes = Tree.Types.Where(n => n is not PredefinedNode and not AbstractNode); 229var valueFields = node.Fields.Where(n => !IsNodeOrNodeList(n.Type)); 230var nodeFields = node.Fields.Where(n => IsNodeOrNodeList(n.Type)); 322var nodes = Tree.Types.Where(n => n is not PredefinedNode and not AbstractNode); 339var valueFields = node.Fields.Where(n => !IsNodeOrNodeList(n.Type)); 340var nodeFields = node.Fields.Where(n => IsNodeOrNodeList(n.Type)); 367var valueFields = node.Fields.Where(n => !IsNodeOrNodeList(n.Type)); 368var nodeFields = node.Fields.Where(n => IsNodeOrNodeList(n.Type));
dotnet-dev-certs (11)
Program.cs (1)
304var trustedCertificates = certificates.Where(cert => certificateManager.GetTrustLevel(cert) == CertificateManager.TrustLevel.Full).ToList();
src\Shared\CertificateGeneration\CertificateManager.cs (6)
96.Where(c => HasOid(c, AspNetHttpsOid)); 110.Where(c => IsValidCertificate(c, now, requireExportable)) 153.Where(e => string.Equals(AspNetHttpsOid, e.Oid?.Value, StringComparison.Ordinal)) 200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
dotnet-getdocument (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
dotnet-openapi (6)
Commands\BaseCommand.cs (2)
156var fileItems = items.Where(i => string.Equals(GetFullPath(i.EvaluatedInclude), GetFullPath(sourceFile), StringComparison.Ordinal)); 488var packages = attributes.Where(a => a.CodeGenerators.Contains(generator));
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
dotnet-sql-cache (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
dotnet-svcutil-lib (37)
Bootstrapper\SvcutilBootstrapper.cs (1)
49return targetFramework.IsDnx && references.Where(r => !r.IsFramework).Except(TargetFrameworkHelper.ServiceModelPackages).Count() > 0;
CodeSerializer.cs (2)
137var wsdlDocuments = metadataSections.Where(s => s.Metadata is WsdlNS.ServiceDescription).Cast<WsdlNS.ServiceDescription>(); 167var schemaDocuments = metadataSections.Where(s => s.Metadata is XmlSchema).Cast<XmlSchema>();
CommandLineParser.cs (1)
127cmd = cmd.Where(c => !c.ToLowerInvariant().Contains("additionalprobingpath")).ToArray();
CommandProcessorOptions.cs (7)
152.Where(s => !s_cmdLineOverwriteSwitches.Contains(s.Name) && s.SwitchLevel <= OperationalContext.Global && options.Any(o => 291var disallowedContextSwitches = CommandSwitch.All.Where(s => s != Switches.ToolContext && s.SwitchLevel > this.ToolContext && userOptions.Any(o => o.HasSameId(s.Name))); 300var disallowedUserOptionsOnUpdateOperation = this.GetOptions().Where(o => !s_cmdLineOverwriteSwitches.Any(n => o.HasSameId(n))); 498var paramsFiles = jsonFiles.Except(excludeJsonFiles).Where(fn => Path.GetFileName(fn).Equals(CommandProcessorOptions.SvcutilParamsFileName, RuntimeEnvironmentHelper.FileStringComparison) || 658var invalidNamespaces = this.NamespaceMappings.Where(nm => !CodeDomHelpers.IsValidNameSpace(nm.Value)); 815var loadableReferences = this.References.Where(r => !TargetFrameworkHelper.ServiceModelPackages.Any(s => s.Name == r.Name)); 1031.Where(o => o.CanSerialize)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (3)
982Type t = type.GetInterfaces().Where(it => it.Equals(interfaceType)).FirstOrDefault(); 1220Type t = type.GetInterfaces().Where(it => it.Equals(interfaceType)).FirstOrDefault(); 1268Type ienumerableInterface = interfaceType.GetInterfaces().Where(t => t.FullName.StartsWith("System.Collections.Generic.IEnumerable")).FirstOrDefault();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (1)
1538.Where(a => a.AttributeType.FullName == Globals.TypeOfDataContractAttribute.FullName)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (2)
1024var matchedMethods = methodBases.Where(method => method.Name.Equals(methodName)); 1025matchedMethods = matchedMethods.Where(method => TypeSequenceEqual(method.GetParameters().Select(param => param.ParameterType).ToArray(), parameterTypes));
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (1)
630foreach (MethodInfo mi in interfaceType.GetRuntimeMethods().Where(m => !m.IsStatic))
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (2)
135foreach (MethodInfo methodInfo in aParentType.GetRuntimeMethods().Where(m => !m.IsStatic)) 687foreach (MethodInfo methodInfo in contractToGetMethodsFrom.GetRuntimeMethods().Where(m => !m.IsStatic))
Metadata\MetadataDocumentLoader.cs (1)
580var chameleonSchemas = schemas.Where(s => string.IsNullOrEmpty(s.TargetNamespace));
Metadata\MetadataDocumentSaver.cs (4)
143var missingRefs = files.Where(file => !this.MetadataFiles.Any(metaFile => MetadataFileNameManager.UriEqual(file.FullName, metaFile.SourceUri))); 227var unresolvedRefs = UnresolvedReferences.Where(u => MetadataFileNameManager.UriEqual(u.WsdlImport?.Location, sourceUrl)).ToList(); 249var unresolvedRefs = UnresolvedReferences.Where(u => 290var mainWsdlFile = wsdlFiles.Where(w => !importedWsdl.Any(i => MetadataFileNameManager.UriEqual(i, w.FilePath))).FirstOrDefault();
Metadata\ServiceDescriptorFactory.cs (1)
100var removeKeys = _cache.Keys.Where((k) => !_cache[k].MetadataImported).ToList();
Shared\MSBuildProj.cs (5)
918foreach (var rtLib in depContext.RuntimeLibraries.Where(l => l.NativeLibraryGroups.Count == 0)) 989var propertyTable = this._resolvedProperties.Where(p => propertyNames.Contains(p.Key)); 1002return this._resolvedProperties.Where(p => propertyNames.Contains(p.Key)); 1022.Where(d => Path.GetFileName(d).Equals(fileName, RuntimeEnvironmentHelper.FileStringComparison)) 1023.Where(f => PathHelper.GetFolderName(Path.GetDirectoryName(f)) == this.TargetFramework || Directory.GetParent(Directory.GetParent(f).FullName).Name == this.TargetFramework)
Shared\Options\ApplicationOptions.cs (1)
223var requestedOptions = this.PropertyBag.Where(p =>
Shared\Options\OptionsSerializer.cs (2)
166var otherOptions = options.GetOptions().Where(o => 212var printOptions = options.GetOptions().Where(o =>
Shared\ProjectPropertyResolver.cs (1)
206.Where(f => PathHelper.PathHasFolder(f, new string[] { targetFramework }, projectDir))
Shared\Utilities\PathHelper.cs (1)
253fullPath = EnumerateItems(workingDir).Where(item => Path.GetFileName(item).Equals(itemName, RuntimeEnvironmentHelper.FileStringComparison)).FirstOrDefault();
Shared\Utilities\ProcessRunner.cs (1)
79foreach (var environmentVar in environmentVariables.Where(e => !string.IsNullOrWhiteSpace(e.Key)))
dotnet-svcutil-lib.Tests (3)
TestInit.cs (3)
482fileLines1 = fileLines1.Where(f => !string.IsNullOrWhiteSpace(f)).ToList(); 483fileLines2 = fileLines2.Where(f => !string.IsNullOrWhiteSpace(f)).ToList(); 563FileInfo nugetFile = binDirectory.GetFiles("dotnet-svcutil-lib.*.nupkg", SearchOption.AllDirectories).Where(f => !f.Name.Contains("symbols")).OrderByDescending(f => f.LastWriteTime).FirstOrDefault();
dotnet-user-jwts (6)
Helpers\ConsoleTable.cs (1)
53.Where(x => x != null)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (1)
31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
dotnet-user-secrets (6)
Internal\SecretsStore.cs (1)
98.Where(i => i.Value != null)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (1)
31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
GenericHostWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
31.Where(kvp => kvp.Key != "link" && kvp.Key != "link_action" && kvp.Key != "link_controller")
GetDocument.Insider (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
Identity.DefaultUI.WebSite (3)
src\Identity\test\InMemory.Test\InMemoryUserStore.cs (3)
50var matchedClaims = user.Claims.Where(uc => uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToList(); 339where user.Claims.Where(x => x.ClaimType == claim.Type && x.ClaimValue == claim.Value).FirstOrDefault() != null 419var updatedCodes = new List<string>(splitCodes.Where(s => s != code));
Identity.ExternalClaims (1)
Pages\Account\Manage\ExternalLogins.cshtml.cs (1)
48.Where(auth => CurrentLogins.All(ul => auth.Name != ul.LoginProvider))
IdentitySample.Mvc (1)
Controllers\ManageController.cs (1)
308var otherLogins = schemes.Where(auth => userLogins.All(ul => auth.Name != ul.LoginProvider)).ToList();
IIS.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (2)
146var xmlFiles = Directory.GetFiles(folderPath).Where(f => f.EndsWith("xml", StringComparison.Ordinal)).ToList(); 158var requestStatus = eventElement.Element(nameSpace + "EventData").Descendants().Where(el => el.Attribute("Name").Value == "requestStatus").SingleOrDefault();
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (1)
240.Where(element =>
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
71matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (1)
72var matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
71matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1517var matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
71matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1517var matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
71matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1517var matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
71matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
IISExpress.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (2)
146var xmlFiles = Directory.GetFiles(folderPath).Where(f => f.EndsWith("xml", StringComparison.Ordinal)).ToList(); 158var requestStatus = eventElement.Element(nameSpace + "EventData").Descendants().Where(el => el.Attribute("Name").Value == "requestStatus").SingleOrDefault();
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (1)
240.Where(element =>
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
71matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1517var matchedEntries = entries.Where(entry => expectedRegex.IsMatch(entry.Message)).ToArray();
illink (18)
ILLink.RoslynAnalyzer (2)
DataFlow\ControlFlowGraphExtensions.cs (1)
34 => cfg.DescendantOperations ().Where (d => d?.Kind == operationKind).Cast<T> ();
src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
60 .Where (damt => (memberTypes & damt) == damt && damt != DynamicallyAccessedMemberTypes.None)
ILLink.Tasks (1)
ComputeManagedAssemblies.cs (1)
29 .Where (f => Utils.IsManagedAssembly (f.ItemSpec))
Infrastructure.Common (1)
xunit\ConditionAttribute.cs (1)
63ITypeInfo type = testMethod.TestClass.Class.Assembly.GetTypes(false).Where(t => t.Name.Contains(symbols[0])).SingleOrDefault();
InMemory.FunctionalTests (14)
BadHttpRequestTests.cs (2)
227Assert.All(TestSink.Writes.Where(w => w.LoggerName != "Microsoft.Hosting.Lifetime"), w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Debug)); 576await connection.ReceiveEnd(lines.Where(f => f != null).ToArray());
EventSourceTests.cs (4)
79var events = _listener.EventData.Where(e => e != null && GetProperty(e, "connectionId") == connectionId).ToList(); 204var events = _listener.EventData.Where(e => e != null && GetProperty(e, "connectionId") == connectionId).ToList(); 308var events = _listener.EventData.Where(e => e != null && GetProperty(e, "connectionId") == connectionId).ToList(); 389var events = _listener.EventData.Where(e => e != null && GetProperty(e, "connectionId") == connectionId).ToList();
Http2\Http2ConnectionTests.cs (1)
6112foreach (var headerField in requestHeaders.Where(h => h.Key.StartsWith(':')))
Http3\Http3StreamTests.cs (1)
2235foreach (var headerField in requestHeaders.Where(h => h.Key.StartsWith(':')))
HttpsConnectionMiddlewareTests.cs (1)
1372Assert.Single(testLogger.Messages.Where(log => log.EventId == 9));
ResponseTests.cs (5)
1294var error = LogMessages.Where(message => message.LogLevel == LogLevel.Error); 2464Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count()); 2524Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count()); 2664Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count()); 2874Assert.Single(LogMessages.Where(m => m.Message.Contains("The connection was aborted by the application via IConnectionLifetimeFeature.Abort().")));
installer.tasks (10)
GenerateFileVersionProps.cs (2)
106.Where(p => 109.Where(p => (p.Value.FileVersion ?? ZeroVersion) == ZeroVersion)
GenerateTestSharedFrameworkDepsFile.cs (1)
54.Where(file => !ignoredExtensions.Contains(Path.GetExtension(file)))
RegenerateDownloadTable.cs (1)
66.Where(line => line.StartsWith("[") && line.Contains("]:"))
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (5)
109foreach (var r in results.Where(r => r.Content != null).OrderBy(r => r.Repo)) 119.Where(g => g.Count(r => r.Content != null) != 1)) 144.Where(r => r != null) 155.Where(s => !newSections.Contains(s)) 171.Where(r => r.Content?.Sections.Contains(s) == true)
StaticFileRegeneration\TpnDocument.cs (1)
36.Where(line => !TpnSectionHeader.IsSeparatorLine(line))
Interop.FunctionalTests (7)
Http3\Http3RequestTests.cs (1)
1905Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Transport.Quic" &&
HttpClientHttp2InteropTests.cs (6)
1068Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("received HEADERS frame for stream ID 1 with length 16384 and flags END_STREAM"))); 1069Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("received CONTINUATION frame for stream ID 1 with length 4390 and flags END_HEADERS"))); 1116Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending HEADERS frame for stream ID 1 with length 15610 and flags END_STREAM"))); 1117Assert.Equal(2, TestSink.Writes.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 15585 and flags NONE")).Count()); 1118Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 14546 and flags END_HEADERS"))); 1177Assert.Single(TestSink.Writes.Where(context
InteropWebsite (2)
TestServiceImpl.cs (2)
101var echoInitialList = context.RequestHeaders.Where((entry) => entry.Key == "x-grpc-test-echo-initial").ToList(); 115var echoTrailingList = context.RequestHeaders.Where((entry) => entry.Key == "x-grpc-test-echo-trailing-bin").ToList();
IOperationGenerator (12)
IOperationClassWriter.cs (11)
314.Where(n => n.OperationKind?.Entries is object) 324.Where(n => ((n is Node && (n.OperationKind?.Include != false)) || 407var ioperationProperties = allProps.Where(p => IsIOperationType(p.Type)).ToList(); 408var publicIOperationProps = ioperationProperties.Where(p => !p.IsInternal).ToList(); 441foreach (var property in type.Properties.Where(p => !p.SkipGeneration)) 551List<Property> propsToInitialize = type.Properties.Where(p => !p.SkipGeneration && !p.MakeAbstract).ToList(); 658return node.OperationKind.Entries.Where(e => e.EditorBrowsable != false).Single().Name; 926return (type.OperationKind?.Entries?.Where(e => e.EditorBrowsable != false).Count() ?? 0) > 1; 1076var properties = node.Properties.Where(p => !p.SkipGeneration || includeSkipGenerationProperties).ToList(); 1085properties.AddRange(@base.Properties.Where(p => !p.SkipGeneration || includeSkipGenerationProperties)); 1093return GetAllProperties(node).Where(p => IsIOperationType(p.Type)).ToList();
IOperationClassWriter.Verifier.cs (1)
86var properties = GetAllGeneratedIOperationProperties(node).Where(p => !p.IsInternal).Select(p => p.Name).ToList();
Microsoft.Analyzers.Extra (12)
AsyncCallInsideUsingBlockAnalyzer.cs (4)
78.Where(IsReturnTypeTask) 79.Where(operation => SymbolInArguments(operation, disposable)); 165.Where(operation => ReferencesSymbol(operation.Instance, taskSymbol)) 173.Where(operation => ReferencesSymbol(operation.Instance, taskSymbol))
CallAnalysis\Arrays.cs (2)
86foreach (var method in freezer.GetMembers("ToFrozenDictionary").OfType<IMethodSymbol>().Where(m => m.TypeParameters.Length == 2)) 95foreach (var method in freezer.GetMembers("ToFrozenSet").OfType<IMethodSymbol>().Where(m => m.TypeParameters.Length == 1))
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
169foreach (var method in targetClass.Members.Where(m => m.IsKind(SyntaxKind.MethodDeclaration)).OfType<MethodDeclarationSyntax>()) 270var allClasses = allNodes.Where(d => d.IsKind(SyntaxKind.ClassDeclaration)).OfType<ClassDeclarationSyntax>();
CallAnalysis\StartsEndsWith.cs (4)
23.Where(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, stringType)) 24.Where(m => 29.Where(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, stringType)) 30.Where(m =>
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
530return diagnostics.Where(d => d.Location.SourceTree!.FilePath.EndsWith(document.Name));
Microsoft.Analyzers.Local (7)
ApiLifecycle\ApiLifecycleAnalyzer.cs (6)
53.Where(symbol => symbol.IsExternallyVisible() && symbol.Kind == SymbolKind.NamedType) 82foreach (var type in assemblyAnalysis.MissingTypes.Where(x => x.Stage != Stage.Experimental)) 87foreach (var method in assemblyAnalysis.MissingMethods.Where(x => x.Stage != Stage.Experimental)) 92foreach (var prop in assemblyAnalysis.MissingProperties.Where(x => x.Stage != Stage.Experimental)) 97foreach (var field in assemblyAnalysis.MissingFields.Where(x => x.Stage != Stage.Experimental)) 147.Where(symbol => symbol.IsExternallyVisible() && symbol.Kind == SymbolKind.NamedType)
ApiLifecycle\AssemblyAnalysis.cs (1)
200.Where(member =>
Microsoft.Analyzers.Local.Tests (3)
InternalReferencedInPublicDocAnalyzerTests.cs (2)
461var detected = result.Where(IsInternalReferencedInPublicDocDiagnostic).ToList(); 480var detected = result.Where(IsInternalReferencedInPublicDocDiagnostic);
Resources\RoslynTestUtils.cs (1)
531return diagnostics.Where(d => d.Location.SourceTree!.FilePath.EndsWith(document.Name));
Microsoft.Arcade.Test.Common (1)
AssertEx.cs (1)
288ToString(actual.Where(i => !predicate(i)))));
Microsoft.AspNetCore.Antiforgery.Test (7)
DefaultAntiforgeryTest.cs (7)
384.Where(wc => wc.LogLevel == LogLevel.Warning) 402.Where(wc => wc.LogLevel == LogLevel.Warning) 420.Where(wc => wc.LogLevel == LogLevel.Warning) 438.Where(wc => wc.LogLevel == LogLevel.Warning) 1300.Where(wc => wc.LogLevel == LogLevel.Warning) 1339.Where(wc => wc.LogLevel == LogLevel.Warning) 1373.Where(wc => wc.LogLevel == LogLevel.Warning)
Microsoft.AspNetCore.App.Analyzers (10)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
77.Where(operation => operation is not IReturnOperation { IsImplicit: true })
Mvc\DetectAmbiguousActionRoutes.cs (1)
38foreach (var ambiguousGroup in groupedByParent.Where(g => g.Count() >= 2))
Mvc\DetectOverriddenAuthorizeAttribute.cs (1)
102ReportOverriddenAuthorizeAttributeDiagnosticsIfAny(context, authorizeAttributes.Where(a => a.IsTargetingMethod), currentClass.Name);
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentOptions.cs (1)
26.Where(f => f.FieldType == typeof(TOptions))
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (2)
98.Where(i => i.Identifier.Text == matchingParameter.Name) 99.Where(i => semanticModel.GetSymbolInfo(i) is var symbolInfo && SymbolEqualityComparer.Default.Equals(symbolInfo.Symbol ?? symbolInfo.CandidateSymbols.FirstOrDefault(), matchingParameter));
RouteHandlers\DetectAmbiguousRoutes.cs (2)
31.Where(u => u.ResolvedOperation != null && !u.MapOperation.RouteUsageModel.UsageContext.HttpMethods.IsDefault) 34foreach (var ambiguousGroup in groupedByParent.Where(g => g.Count() >= 2))
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (2)
283.Where(node => node is IdentifierNameSyntax || node is GenericNameSyntax) 284.Where(node => string.Equals(node.Identifier.Value as string, operation.TargetMethod.Name, StringComparison.Ordinal))
Microsoft.AspNetCore.App.Analyzers.Test (1)
Http\HeaderDictionaryIndexerAnalyzerTests.cs (1)
165.Where(p => p.CanWrite && p.CanRead && p.PropertyType == typeof(StringValues) && p.GetIndexParameters().Length == 0)
Microsoft.AspNetCore.App.CodeFixes (2)
Authorization\AddAuthorizationBuilderFixer.cs (1)
120.Where(trivia => !trivia.IsKind(SyntaxKind.EndOfLineTrivia));
Dependencies\ExtensionMethodsCompletionProvider.cs (1)
72var matchingExtensionMethods = wellKnownExtensionMethodCache.Where(pair => IsMatchingExtensionMethod(pair, symbolType, token));
Microsoft.AspNetCore.App.UnitTests (9)
PackageTests.cs (2)
44.Where(file => !file.EndsWith(".symbols.nupkg", StringComparison.OrdinalIgnoreCase)); 123.Where(f => !toolAssembliesToSkip.Any(s => Path.GetFileNameWithoutExtension(f).Contains(s, StringComparison.OrdinalIgnoreCase)));
SharedFxTests.cs (1)
333.Where(i => i.FullName.EndsWith(".dll", StringComparison.Ordinal))
TargetingPackTests.cs (6)
248.Where(s => !string.IsNullOrEmpty(s)) 301var managedEntries = frameworkListEntries.Where(i => i.Attribute("Type").Value.Equals("Managed", StringComparison.Ordinal)); 302var analyzerEntries = frameworkListEntries.Where(i => i.Attribute("Type").Value.Equals("Analyzer", StringComparison.Ordinal)); 308.Where(f => !f.EndsWith(".resources", StringComparison.OrdinalIgnoreCase)) 375.Where(i => i.FullName.EndsWith(".dll", StringComparison.Ordinal) && !i.FullName.EndsWith(".resources.dll", StringComparison.Ordinal)) 407var analyzerEntries = frameworkListEntries.Where(i => i.Attribute("Type").Value.Equals("Analyzer", StringComparison.Ordinal));
Microsoft.AspNetCore.Authentication (1)
src\Shared\SecurityHelper\SecurityHelper.cs (1)
42newPrincipal.AddIdentities(existingPrincipal.Identities.Where(i => i.IsAuthenticated || i.Claims.Any()));
Microsoft.AspNetCore.Authentication.Core (2)
AuthenticationService.cs (2)
258.Where(sch => typeof(IAuthenticationSignInHandler).IsAssignableFrom(sch.HandlerType)) 298.Where(sch => typeof(IAuthenticationSignOutHandler).IsAssignableFrom(sch.HandlerType))
Microsoft.AspNetCore.Authentication.OAuth (1)
ClaimActionCollection.cs (1)
27var itemsToRemove = Actions.Where(map => string.Equals(claimType, map.ClaimType, StringComparison.OrdinalIgnoreCase)).ToList();
Microsoft.AspNetCore.Authentication.Test (22)
CertificateTests.cs (20)
480var actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == "issuer"); 484actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Thumbprint); 491actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.X500DistinguishedName); 501actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.SerialNumber); 511actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Dns); 521actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Email); 531actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Name); 541actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Upn); 551actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Uri); 609var name = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Name); 612var count = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == "ValidationCount"); 628name = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Name); 631count = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == "ValidationCount"); 679var actual = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Name); 736var name = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Name); 739var count = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == "ValidationCount"); 755name = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Name); 758count = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == "ValidationCount"); 777name = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == ClaimTypes.Name); 780count = responseAsXml.Elements("claim").Where(claim => claim.Attribute("Type").Value == "ValidationCount");
OpenIdConnect\OpenIdConnectChallengeTests.cs (2)
440var nonceCookie = challengeCookies.Where(cookie => cookie.Name.StartsWith(OpenIdConnectDefaults.CookieNoncePrefix, StringComparison.Ordinal)).Single(); 448var correlationCookie = challengeCookies.Where(cookie => cookie.Name.StartsWith(".AspNetCore.Correlation.", StringComparison.Ordinal)).Single();
Microsoft.AspNetCore.Authorization (1)
AuthorizationPolicy.cs (1)
155var trimmedRolesSplit = rolesSplit.Where(r => !string.IsNullOrWhiteSpace(r)).Select(r => r.Trim());
Microsoft.AspNetCore.Authorization.Policy (1)
src\Shared\SecurityHelper\SecurityHelper.cs (1)
42newPrincipal.AddIdentities(existingPrincipal.Identities.Where(i => i.IsAuthenticated || i.Claims.Any()));
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.Authorization.Tests (5)
AuthorizeRouteViewTest.cs (4)
235var nonEmptyDiff = batch.DiffsInOrder.Where(d => d.Edits.Any()).Single(); 286.Where(f => f.FrameType == RenderTreeFrameType.Component) 315.Where(f => f.FrameType == RenderTreeFrameType.Component) 353var diff = batch2.DiffsInOrder.Where(d => d.Edits.Any()).Single();
src\Components\Shared\test\CapturedBatch.cs (1)
20=> ReferenceFrames.Where(f => f.FrameType == RenderTreeFrameType.Component && f.Component is T);
Microsoft.AspNetCore.Components.Endpoints.Tests (7)
HotReloadServiceTests.cs (4)
67var pageEndpoints = endpointDataSource.Endpoints.Where(e => e.Metadata.GetMetadata<RootComponentMetadata>() != null).ToList(); 95var pageEndpoints = endpointDataSource.Endpoints.Where(e => e.Metadata.GetMetadata<RootComponentMetadata>() != null).ToList(); 145var pageEndpoints = endpointDataSource.Endpoints.Where(e => e.Metadata.GetMetadata<RootComponentMetadata>() != null).ToList(); 146var compositePageEndpoints = compositeEndpointDataSource.Endpoints.Where(e => e.Metadata.GetMetadata<RootComponentMetadata>() != null).ToList();
RazorComponentsServiceCollectionExtensionsTest.cs (3)
80.Where(sd => !multiRegistrationServiceTypes.ContainsKey(sd.ServiceType)) 105var serviceDescriptors = services.Where(serviceDescriptor => serviceDescriptor.ServiceType == serviceType); 120.Where(sd => sd.ServiceType == serviceType)
Microsoft.AspNetCore.Components.Forms.Tests (1)
src\Components\Shared\test\CapturedBatch.cs (1)
20=> ReferenceFrames.Where(f => f.FrameType == RenderTreeFrameType.Component && f.Component is T);
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\ServerComponentDeserializerTest.cs (1)
198.Where(m => m.Sequence != 1)
Microsoft.AspNetCore.Components.Tests (26)
RendererTest.cs (24)
265var logForParent = log.Where(l => l.id == 0).ToArray(); 266var logForChild = log.Where(l => l.id == 1).ToArray(); 424var logForParent = log.Where(l => l.id == 0).ToArray(); 425var logForChild = log.Where(l => l.id == 1).ToArray(); 468var logForParent = log.Where(l => l.id == 0).ToArray(); 469var logForChild = log.Where(l => l.id == 1).ToArray(); 528var logForParent = log.Where(l => l.id == 0).ToArray(); 529var logForFirstChild = log.Where(l => l.id == 1).ToArray(); 530var logForSecondChild = log.Where(l => l.id == 2).ToArray(); 531var logForThirdChild = log.Where(l => l.id == 3).ToArray(); 2242.Where(frame => frame.FrameType == RenderTreeFrameType.Component) 2245var childComponent3 = batch.ReferenceFrames.Where(f => f.ComponentId == 3) 2644.Where(f => f.FrameType == RenderTreeFrameType.Component) 2650.Where(f => f.FrameType == RenderTreeFrameType.Attribute) 2684.Where(f => f.FrameType == RenderTreeFrameType.Attribute) 2726.Where(f => f.FrameType == RenderTreeFrameType.Attribute) 2771.Where(f => f.FrameType == RenderTreeFrameType.Component) 2777.Where(f => f.FrameType == RenderTreeFrameType.Attribute) 2812.Where(f => f.FrameType == RenderTreeFrameType.Attribute) 2864.Where(f => f.FrameType == RenderTreeFrameType.Attribute) 3052.Where(f => f.ComponentId != 0) 3057.Where(f => f.FrameType == RenderTreeFrameType.Attribute && f.AttributeName == "onmycustomevent") 5654var parametersSetEvent = logStream.Where(le => le == (expectedId, NestedAsyncComponent.EventType.OnParametersSet)).ToArray(); 5659.Where(le => le == (expectedId, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync) ||
RenderTreeDiffBuilderTest.cs (1)
2438.Where(x => x.FrameType == RenderTreeFrameType.Component)
src\Components\Shared\test\CapturedBatch.cs (1)
20=> ReferenceFrames.Where(f => f.FrameType == RenderTreeFrameType.Component && f.Component is T);
Microsoft.AspNetCore.Components.Web.Tests (4)
Forms\EditFormTest.cs (1)
209.Where(f => f.FrameType == RenderTreeFrameType.Component)
Forms\InputRadioTest.cs (1)
107.Where(f => f.FrameType == RenderTreeFrameType.Component)
Forms\InputRenderer.cs (1)
22.Where(f => f.FrameType == RenderTreeFrameType.Component)
src\Components\Shared\test\CapturedBatch.cs (1)
20=> ReferenceFrames.Where(f => f.FrameType == RenderTreeFrameType.Component && f.Component is T);
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
DebugProxyLauncher.cs (1)
111var keysToRemove = environment.Keys.Where(key => key.StartsWith("ASPNETCORE_", StringComparison.Ordinal)).ToList();
TargetPickerUi.cs (1)
304: availableTabs.Where(t => t.Url.Equals(targetApplicationUrl, StringComparison.Ordinal)).ToList();
Microsoft.AspNetCore.Components.WebView.Test (2)
StaticContentProviderTests.cs (2)
63.Where(kvp => kvp.Key == subpath) 91.Where(kvp => kvp.Key.StartsWith(_subPath, StringComparison.Ordinal))
Microsoft.AspNetCore.Cors (1)
Infrastructure\CorsPolicyExtensions.cs (1)
22.Where(o => o.Contains($"://{_WildcardSubdomain}"))
Microsoft.AspNetCore.DataProtection (4)
KeyManagement\DefaultKeyResolver.cs (1)
195var unrevokedKeys = allKeys.Where(key => !key.IsRevoked);
Repositories\EphemeralXmlRepository.cs (1)
77.Where(e => e.DeletionOrder.HasValue)
Repositories\FileSystemXmlRepository.cs (1)
196.Where(e => e.DeletionOrder.HasValue)
Repositories\RegistryXmlRepository.cs (1)
178.Where(e => e.DeletionOrder.HasValue)
Microsoft.AspNetCore.DataProtection.Tests (4)
XmlAssert.cs (4)
57List<XNode> filteredExpected = expected.Where(ShouldIncludeNodeDuringComparison).ToList(); 58List<XNode> filteredActual = actual.Where(ShouldIncludeNodeDuringComparison).ToList(); 86.Where(ShouldIncludeAttributeDuringComparison) 91.Where(ShouldIncludeAttributeDuringComparison)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (6)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
96.Where(c => HasOid(c, AspNetHttpsOid)); 110.Where(c => IsValidCertificate(c, now, requireExportable)) 153.Where(e => string.Equals(AspNetHttpsOid, e.Oid?.Value, StringComparison.Ordinal)) 200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (3)
Views\DatabaseErrorPage.Designer.cs (3)
185var contextWithNoDBOrMigrations = Model.ContextDetails.Where(c => !c.DatabaseExists && !c.PendingMigrations.Any()); 286var contextWithPendingMigrations = Model.ContextDetails.Where(c => c.PendingMigrations.Any()).Except(contextWithNoDBOrMigrations); 478var contextWithPendingModelChanges = Model.ContextDetails.Where(c => c.PendingModelChanges).Except(contextWithNoDBOrMigrations).Except(contextWithPendingMigrations);
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (2)
398.Where(f => f.IsStatic) 399.Where(f => f.GetCustomAttributes<OriginalNameAttribute>()
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
JsonTranscodingServiceMethodProviderTests.cs (1)
237.Where(e => e.Metadata.GetMetadata<GrpcMethodMetadata>()?.Method.Name == methodName)
Microsoft.AspNetCore.Grpc.Swagger (3)
Internal\XmlComments\GrpcXmlCommentsDocumentFilter.cs (1)
31.Where(actionDesc => actionDesc != null && (actionDesc.EndpointMetadata?.Any(m => m is GrpcMethodMetadata) ?? false))
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (2)
398.Where(f => f.IsStatic) 399.Where(f => f.GetCustomAttributes<OriginalNameAttribute>()
Microsoft.AspNetCore.Hosting (4)
Internal\StartupLoader.cs (4)
271var startupType1 = definedTypes.Where(info => info.Name.Equals(startupNameWithEnv, StringComparison.OrdinalIgnoreCase)); 272var startupType2 = definedTypes.Where(info => info.Name.Equals(startupNameWithoutEnv, StringComparison.OrdinalIgnoreCase)); 324var selectedMethods = methods.Where(method => method.Name.Equals(methodNameWithEnv, StringComparison.OrdinalIgnoreCase)).ToList(); 331selectedMethods = methods.Where(method => method.Name.Equals(methodNameWithNoEnv, StringComparison.OrdinalIgnoreCase)).ToList();
Microsoft.AspNetCore.Http.Connections (1)
src\Shared\SecurityHelper\SecurityHelper.cs (1)
42newPrincipal.AddIdentities(existingPrincipal.Identities.Where(i => i.IsAuthenticated || i.Claims.Any()));
Microsoft.AspNetCore.Http.Extensions (1)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
233.Where(m => m.Name.Equals("StartAsTask", StringComparison.Ordinal));
Microsoft.AspNetCore.Http.Extensions.Tests (2)
ProblemDetailsServiceCollectionExtensionsTest.cs (1)
62var serviceDescriptors = collection.Where(serviceDescriptor => serviceDescriptor.ServiceType == typeof(IProblemDetailsWriter));
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (1)
521var filteredMetadata = endpoint.Metadata.Where(
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
RequestDelegateGenerator.cs (1)
166.Where(verb => verb is not null)
StaticRouteHandlerModel\EndpointParameter.cs (2)
473var properties = type.GetMembers().OfType<IPropertySymbol>().Where(property => property.DeclaredAccessibility == Accessibility.Public); 474var writableProperties = properties.Where(property => !property.IsReadOnly);
Microsoft.AspNetCore.Http.Results.Tests (1)
ResultsTests.cs (1)
1711.Where(m => !m.IsSpecialName)
Microsoft.AspNetCore.Http.Tests (3)
DefaultHttpContextTests.cs (2)
367.Where(p => p.PropertyType.GetTypeInfo().IsInterface); 373.Where(f => f.FieldType.GetTypeInfo().IsInterface && f.GetCustomAttribute<CompilerGeneratedAttribute>() == null);
HeaderDictionaryTests.cs (1)
50var expectedResult = segments.Where(s => !string.IsNullOrEmpty(s));
Microsoft.AspNetCore.HttpLogging.Tests (12)
HttpLoggingMiddlewareTests.cs (12)
1528var lines = Assert.Single(TestSink.Writes.Where(w => w.LogLevel >= LogLevel.Information)).Message.Split(Environment.NewLine); 1733var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1748var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1763var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1780var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1806var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1823var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1838var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1853var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1870var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1896var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1942var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging"));
Microsoft.AspNetCore.Identity (1)
SignInManager.cs (1)
678return schemes.Where(s => !string.IsNullOrEmpty(s.DisplayName));
Microsoft.AspNetCore.Identity.EntityFrameworkCore (4)
IdentityUserContext.cs (4)
184var personalDataProps = typeof(TUser).GetProperties().Where( 232var tokenProps = typeof(TUserToken).GetProperties().Where( 277var personalDataProps = typeof(TUser).GetProperties().Where( 325var tokenProps = typeof(TUserToken).GetProperties().Where(
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (3)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (3)
20from method in type.DeclaredMethods.Where(m => m.IsPublic && !m.IsStatic) 40from method in type.DeclaredMethods.Where(m => m.IsPublic) 47.Where(method => !method.Name.EndsWith("Async", StringComparison.Ordinal))
Microsoft.AspNetCore.Identity.InMemory.Test (8)
InMemoryStore.cs (2)
62var role = _roles.Values.Where(x => x.NormalizedName.Equals(roleName)).SingleOrDefault(); 67return Task.FromResult<IList<TUser>>(Users.Where(u => (u.Roles.Where(x => x.RoleId == role.Id).Any())).Select(x => x).ToList());
InMemoryUserStore.cs (3)
50var matchedClaims = user.Claims.Where(uc => uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToList(); 339where user.Claims.Where(x => x.ClaimType == claim.Type && x.ClaimValue == claim.Value).FirstOrDefault() != null 419var updatedCodes = new List<string>(splitCodes.Where(s => s != code));
src\Identity\test\Shared\ApiConsistencyTestBase.cs (3)
20from method in type.DeclaredMethods.Where(m => m.IsPublic && !m.IsStatic) 40from method in type.DeclaredMethods.Where(m => m.IsPublic) 47.Where(method => !method.Name.EndsWith("Async", StringComparison.Ordinal))
Microsoft.AspNetCore.Identity.Test (5)
IdentityUIScriptsTest.cs (2)
31.Where(st => st.Integrity != null) 75.Where(st => st.FallbackSrc != null)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (3)
20from method in type.DeclaredMethods.Where(m => m.IsPublic && !m.IsStatic) 40from method in type.DeclaredMethods.Where(m => m.IsPublic) 47.Where(method => !method.Name.EndsWith("Async", StringComparison.Ordinal))
Microsoft.AspNetCore.Identity.UI (5)
Areas\Identity\Pages\V4\Account\Manage\DownloadPersonalData.cshtml.cs (1)
62var personalDataProps = typeof(TUser).GetProperties().Where(
Areas\Identity\Pages\V4\Account\Manage\ExternalLogins.cshtml.cs (1)
94.Where(auth => CurrentLogins.All(ul => auth.Name != ul.LoginProvider))
Areas\Identity\Pages\V5\Account\Manage\DownloadPersonalData.cshtml.cs (1)
62var personalDataProps = typeof(TUser).GetProperties().Where(
Areas\Identity\Pages\V5\Account\Manage\ExternalLogins.cshtml.cs (1)
94.Where(auth => CurrentLogins.All(ul => auth.Name != ul.LoginProvider))
IdentityBuilderUIExtensions.cs (1)
71var environment = builder.Services.Where(d => d.ServiceType == typeof(IWebHostEnvironment)).ToArray();
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\BindingInfo.cs (1)
286.Where(p => p != null);
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
1204responseType.ApiResponseFormats.Where(responseFormat => responseFormat.MediaType == "text/json"));
Microsoft.AspNetCore.Mvc.Core (21)
ApiConventionMethodAttribute.cs (1)
50.Where(method => method.Name == methodName)
ApiConventionTypeAttribute.cs (1)
64.Where(attribute => !IsAllowedAttribute(attribute))
ApplicationModels\ActionAttributeRouteModel.cs (2)
17.Where(sm => sm.AttributeRouteModel != null) 146.Where(sm => sm.AttributeRouteModel != null)
ApplicationModels\ControllerActionDescriptorBuilder.cs (1)
57.Where(p => p.BindingInfo != null)
ApplicationModels\InferParameterBindingInfoConvention.cs (1)
92var fromBodyParameters = action.Parameters.Where(p => p.BindingInfo!.BindingSource == BindingSource.Body).ToList();
Filters\MiddlewareFilterConfigurationProvider.cs (1)
44var selectedMethods = methods.Where(method => method.Name.Equals(methodName)).ToList();
Infrastructure\ActionSelectionTable.cs (2)
67items: actions.Items.Where(a => a.AttributeRouteInfo == null), 86items: endpoints.Where(e =>
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (1)
183.Where(p => p != null);
MvcCoreLoggerExtensions.cs (5)
32var authorizationFilters = filters.Where(f => f is IAuthorizationFilter || f is IAsyncAuthorizationFilter); 43var resourceFilters = filters.Where(f => f is IResourceFilter || f is IAsyncResourceFilter); 54var actionFilters = filters.Where(f => f is IActionFilter || f is IAsyncActionFilter); 65var exceptionFilters = filters.Where(f => f is IExceptionFilter || f is IAsyncExceptionFilter); 76var resultFilters = filters.Where(f => f is IResultFilter || f is IAsyncResultFilter);
Routing\AttributeRoute.cs (2)
131.Where(routeInfo => !routeInfo.SuppressPathMatching) 147var attributeRoutedActions = actions.Where(a => a.AttributeRouteInfo?.Template != null);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
233.Where(m => m.Name.Equals("StartAsTask", StringComparison.Ordinal));
src\Shared\PropertyActivator\PropertyActivator.cs (2)
86.Where((property) => 97properties = properties.Where(property => property.SetMethod is { IsPublic: true });
src\Shared\SecurityHelper\SecurityHelper.cs (1)
42newPrincipal.AddIdentities(existingPrincipal.Identities.Where(i => i.IsAuthenticated || i.Claims.Any()));
Microsoft.AspNetCore.Mvc.Core.Test (47)
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (1)
93var attributeRoutes = action.Selectors.Where(sm => sm.AttributeRouteModel != null);
ApplicationModels\ControllerActionDescriptorProviderTests.cs (18)
312.Where(d => d.ActionName == nameof(NonDuplicatedAttributeRouteController.DifferentHttpMethods)); 453var actions = descriptors.Where(d => d.ActionName == "MultipleHttpGet"); 478var actions = descriptors.Where(d => d.ActionName == nameof(MultiRouteAttributesController.AcceptVerbs)); 530var actions = descriptors.Where(d => d.ActionName == "AcceptVerbsRouteAttributeAndHttpPut"); 541var constrainedActions = actions.Where(a => a.ActionConstraints != null); 545var putActions = constrainedActions.Where( 552var routeActions = actions.Where( 569var actions = descriptors.Where(d => d.ActionName == "AcceptVerbsRouteAttributeWithTemplateAndHttpPut"); 580var constrainedActions = actions.Where(a => a.ActionConstraints != null); 584var postActions = constrainedActions.Where( 591var putActions = constrainedActions.Where( 598var unconstrainedActions = actions.Where(a => a.ActionConstraints == null); 639var actions = descriptors.Where(d => d.ActionName.Equals(actionName)); 811var getActions = actions.Where(a => a.ActionName.Equals(getActionName)); 839var getActions = actions.Where(a => a.ActionName.Equals(getActionName)); 1211var actions = provider.GetDescriptors().Where(a => a.ActionName == actionName); 1238var actions = provider.GetDescriptors().Where(a => a.ActionName == actionName); 1277var actions = provider.GetDescriptors().Where(a => a.ActionName == actionName);
ApplicationModels\DefaultApplicationModelProviderTest.cs (4)
618var methods = typeInfo.AsType().GetMethods().Where(m => m.Name.Equals("Dispose") && m != methodInfo); 690var methods = typeInfo.AsType().GetMethods().Where(m => m.Name.Equals("Dispose") && m != methodInfo); 710var methods = typeInfo.AsType().GetMethods().Where(m => m.Name.Equals("Dispose")); 1387.Where(sm => sm.AttributeRouteModel != null)
ApplicationModels\InferParameterBindingInfoConventionTest.cs (1)
939return Assert.Single(action.Parameters.Where(x => typeof(T).IsAssignableFrom(x.ParameterType)));
ControllerBaseTest.cs (1)
33.Where(method => method.IsPublic &&
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (3)
223.Where(sd => !multiRegistrationServiceTypes.ContainsKey(sd.ServiceType)) 343var serviceDescriptors = services.Where(serviceDescriptor => serviceDescriptor.ServiceType == serviceType); 358.Where(sd =>
Infrastructure\ActionSelectorTest.cs (3)
1058.Where(a => a.RouteValues.Any(kvp => kvp.Key == "area" && comparer.Equals(kvp.Value, area))) 1059.Where(a => a.RouteValues.Any(kvp => kvp.Key == "controller" && comparer.Equals(kvp.Value, controller))) 1060.Where(a => a.RouteValues.Any(kvp => kvp.Key == "action" && comparer.Equals(kvp.Value, action)));
Infrastructure\ControllerActionInvokerTest.cs (1)
1664ParameterInfo = method.GetParameters().Where(p => p.Name == kvp.Key).Single(),
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (1)
241return base.GetMetadataForProperties(modelType).Where(property => !_shouldExclude(property));
RequestFormLimitsAttributeTest.cs (2)
22.Where(pi => property.Name == pi.Name && pi.PropertyType == property.PropertyType) 43.Where(pi => pi.Name == formOptionsProperty.Name && pi.PropertyType == formOptionsProperty.PropertyType)
Routing\ControllerActionEndpointDataSourceTest.cs (11)
91endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 104endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 173endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 188endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 260endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 273endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 342endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 357endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 436endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 453endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 526endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText),
TestFeatureProvider.cs (1)
26foreach (var type in parts.OfType<IApplicationPartTypeProvider>().SelectMany(t => t.Types).Where(_filter))
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (4)
DataAnnotationsMetadataProviderTest.cs (4)
1388var parameter = method.GetParameters().Where(p => p.Name == "defaultValueParameter").Single(); 1409var parameter = method.GetParameters().Where(p => p.Name == "nonNullableParameter").Single(); 1653var parameter = method.GetParameters().Where(p => p.Name == "nonNullableParameter").Single(); 1670var parameter = method.GetParameters().Where(p => p.Name == "nullableParameter").Single();
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
TempDataInCookiesTest.cs (2)
37var tempDataSerializers = _serviceCollection.Where(f => f.ServiceType == typeof(TempDataSerializer)).ToList(); 70setCookieValues = setCookieValues.Where(cookie => cookie.Contains(CookieTempDataProvider.CookieName));
Microsoft.AspNetCore.Mvc.Localization.Test (1)
MvcLocalizationServiceCollectionExtensionsTest.cs (1)
57.Where(sd =>
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (3)
CompilationFailedExceptionFactory.cs (1)
54.Where(diagnostic => diagnostic.IsWarningAsError || diagnostic.Severity == DiagnosticSeverity.Error)
CSharpCompiler.cs (1)
214var defines = dependencyContextOptions.Defines.Concat(new[] { configurationSymbol }).Where(define => define != null);
PageActionDescriptorChangeProvider.cs (1)
81.Where(f => f.FilePath != null)
Microsoft.AspNetCore.Mvc.RazorPages.Test (3)
ApplicationModels\DefaultPageApplicationModelProviderTest.cs (3)
146.Where(p => p.PropertyInfo.DeclaringType.GetTypeInfo() == typeInfo); 244context.PageApplicationModel.HandlerProperties.OrderBy(p => p.PropertyName).Where(p => p.BindingInfo != null), 630.Where(p => p.PropertyInfo.DeclaringType.GetTypeInfo() == typeInfo);
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 (5)
OptionTagHelperTest.cs (2)
357return GeneratesExpectedDataSet.Where( 369return GeneratesExpectedDataSet.Where(entry => entry[1] != null);
TagHelperOutputExtensionsTest.cs (3)
569.Where(item => item.Name.StartsWith("route-", StringComparison.OrdinalIgnoreCase)) 596.Where(item => item.Name.StartsWith("route-", StringComparison.OrdinalIgnoreCase)); 623.Where(item => item.Name.StartsWith("route-", StringComparison.OrdinalIgnoreCase));
Microsoft.AspNetCore.Mvc.Test (5)
MvcServiceCollectionExtensionsTest.cs (5)
418foreach (var serviceType in services.Select(d => d.ServiceType).Where(t => !t.IsGenericTypeDefinition).Distinct()) 465.Where(sd => !multiRegistrationServiceTypes.ContainsKey(sd.ServiceType)) 466.Where(sd => sd.ServiceType.Assembly.FullName.Contains("Mvc")) 619var serviceDescriptors = services.Where(serviceDescriptor => serviceDescriptor.ServiceType == serviceType); 635.Where(sd =>
Microsoft.AspNetCore.Mvc.Testing (3)
WebApplicationFactory.cs (3)
308.Where(a => string.Equals(a.Key, tEntryPointAssemblyFullName, StringComparison.OrdinalIgnoreCase) || 339var projects = context.CompileLibraries.Where(l => l.Type == "project"); 345.Where(library => library.Dependencies.Any(d => string.Equals(d.Name, entryPointAssemblyName, StringComparison.Ordinal)));
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
DefaultHtmlGenerator.cs (1)
1015.Where(kvp => string.Equals(integerString, kvp.Value, StringComparison.Ordinal))
TemplateRenderer.cs (1)
155foreach (var templateHint in templateHints.Where(s => !string.IsNullOrEmpty(s)))
ViewComponents\DefaultViewComponentDescriptorProvider.cs (1)
67.Where(method =>
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
ControllerTest.cs (1)
26.Where(method => method.IsPublic &&
ViewDataDictionaryTest.cs (1)
161{ model.Where(t => t != null) },
Microsoft.AspNetCore.OpenApi (4)
Extensions\ApiDescriptionExtensions.cs (2)
95formParameters = apiDescription.ParameterDescriptions.Where(parameter => parameter.Source == BindingSource.Form || parameter.Source == BindingSource.FormFile); 108var bodyParameters = apiDescription.ParameterDescriptions.Where(parameter => parameter.Source == BindingSource.Body);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
233.Where(m => m.Name.Equals("StartAsTask", StringComparison.Ordinal));
Transformers\Implementations\OpenApiSchemaReferenceTransformer.cs (1)
25foreach (var (schema, referenceId) in schemasByReference.Where(kvp => kvp.Value is not null).OrderBy(kvp => kvp.Value))
Microsoft.AspNetCore.OpenApi.Tests (8)
Transformers\SchemaTransformerTests.cs (8)
499var triangleSubschema = Assert.Single(requestSchema.AnyOf.Where(s => s.Reference.Id == "ShapeTriangle")); 574var triangleSubschema = Assert.Single(itemSchema.AnyOf.Where(s => s.Reference.Id == "ShapeTriangle")); 580var squareSubschema = Assert.Single(itemSchema.AnyOf.Where(s => s.Reference.Id == "ShapeSquare")); 615var triangleSubschema = Assert.Single(someShapeSchema.AnyOf.Where(s => s.Reference.Id == "ShapeTriangle")); 621var squareSubschema = Assert.Single(someShapeSchema.AnyOf.Where(s => s.Reference.Id == "ShapeSquare")); 656var triangleSubschema = Assert.Single(someShapeSchema.AnyOf.Where(s => s.Reference.Id == "ShapeTriangle")); 662var squareSubschema = Assert.Single(someShapeSchema.AnyOf.Where(s => s.Reference.Id == "ShapeSquare")); 741var triangleSchema = Assert.Single(shapeRequestSchema.AnyOf.Where(s => s.Reference.Id == "ShapeTriangle")).GetEffective(document);
Microsoft.AspNetCore.Owin (1)
OwinEnvironment.cs (1)
162return _entries.Where(pair => pair.Value.TryGet(_context, out _))
Microsoft.AspNetCore.Routing.Tests (9)
DefaultLinkGeneratorTest.cs (1)
745return _dataSource.Endpoints.Where(e => e.Metadata.GetMetadata<IntMetadata>().Value == address);
DefaultLinkParserTest.cs (1)
174return _dataSource.Endpoints.Where(e => e.Metadata.GetMetadata<IntMetadata>().Value == address);
EndpointRoutingMiddlewareTest.cs (7)
87var write = Assert.Single(sink.Writes.Where(w => w.EventId.Name == "MatchSuccess")); 259var write = Assert.Single(sink.Writes.Where(w => w.EventId.Name == "FallbackMatch")); 293var write = Assert.Single(sink.Writes.Where(w => w.EventId.Name == "RequestSizeFeatureIsReadOnly")); 322var write = Assert.Single(sink.Writes.Where(w => w.EventId.Name == "RequestSizeFeatureNotFound")); 350var write = Assert.Single(sink.Writes.Where(w => w.EventId.Name == "RequestSizeLimitMetadataNotFound")); 384var write = Assert.Single(sink.Writes.Where(w => w.EventId.Name == "MaxRequestBodySizeDisabled")); 389var write = Assert.Single(sink.Writes.Where(w => w.EventId.Name == "MaxRequestBodySizeSet"));
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.Kestrel.Core (8)
CertificateLoader.cs (2)
44.Where(IsCertificateAllowedForServerAuth) 45.Where(DoesCertificateHaveAnAccessiblePrivateKey)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
96.Where(c => HasOid(c, AspNetHttpsOid)); 110.Where(c => IsValidCertificate(c, now, requireExportable)) 153.Where(e => string.Equals(AspNetHttpsOid, e.Oid?.Value, StringComparison.Ordinal)) 200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (26)
CertificatePathWatcherTests.cs (1)
474var writeContext = Assert.Single(testSink.Writes.Where(wc => wc.EventId.Name == eventName));
ConnectionDispatcherTests.cs (1)
113var errors = TestSink.Writes.Where(e => e.LogLevel >= LogLevel.Error).ToArray();
Http1\Http1HttpProtocolFeatureCollectionTests.cs (1)
204var matches = _collection.Where(kv => ReferenceEquals(kv.Value, item.Value)).ToList();
HttpConnectionManagerTests.cs (1)
36Assert.Single(TestSink.Writes.Where(c => c.EventId.Name == "ApplicationNeverCompleted"));
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 }));
KestrelServerTests.cs (2)
211return (testLogger.Messages.Where(log => log.EventId == 64), testLogger.Messages.Where(log => log.EventId == 65));
src\Servers\Kestrel\shared\KnownHeaders.cs (18)
39.Where(h => h.GetCustomAttribute(typeof(ObsoleteAttribute)) == null) 298.Where(header => invalidH2H3ResponseHeaders.Contains(header.Name)) 303.Where(header => FormattedInternalHeaderNames.Where(x => x.IsPseudoHeader).Select(x => x.Identifier).Contains(header.Identifier)) 810foreach (var loop in loops.Where(l => l.Bytes != null)) 864{Each(loop.Headers.Where(header => header.ExistenceCheck), header => $@" 866{Each(loop.Headers.Where(header => header.FastCount), header => $@" 868{Each(loop.Headers.Where(header => Array.IndexOf(InternalHeaderAccessors, header.Name) >= 0), header => $@" 906{Each(loop.Headers.Where(header => header.Name != HeaderNames.ContentLength && !NonApiHeaders.Contains(header.Identifier)), header => $@" 937{Each(ApiHeaderNames.Where(header => header != "ContentLength" && !loop.Headers.Select(kh => kh.Identifier).Contains(header)), header => $@" 956{Each(loop.Headers.Where(header => header.EnhancedSetter), header => $@" 1152{Each(loop.Headers.Where(header => header.Identifier != "ContentLength").OrderBy(h => !h.PrimaryHeader), header => $@" 1168{Each(loop.Headers.Where(header => header.Identifier != "ContentLength").OrderBy(h => !h.PrimaryHeader), header => $@" 1187{Each(loop.Headers.Where(header => header.Identifier != "ContentLength"), header => $@" 1240{{{Each(loop.Headers.OrderBy(h => h.Index).Where(h => h.Identifier != "ContentLength"), header => $@" 1384{{{Each(loop.Headers.Where(header => header.Identifier != "ContentLength"), header => @" 1386{Each(loop.Headers.Where(header => header.EnhancedSetter), header => @" 1396{{{Each(loop.Headers.Where(header => header.Identifier != "ContentLength"), header => $@"
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (4)
InMemoryTransportBenchmark.cs (2)
74var expectedResponseLines = expectedResponse.Split("\r\n").Where(s => !s.StartsWith("Date:", StringComparison.Ordinal)); 75var responseLines = response.Split("\r\n").Where(s => !s.StartsWith("Date:", StringComparison.Ordinal));
NamedPipesTransportBenchmark.cs (2)
76var expectedResponseLines = expectedResponse.Split("\r\n").Where(s => !s.StartsWith("Date:", StringComparison.Ordinal)); 77var responseLines = response.Split("\r\n").Where(s => !s.StartsWith("Date:", StringComparison.Ordinal));
Microsoft.AspNetCore.Session.Tests (6)
SessionTests.cs (6)
879var sessionLogMessage = sink.Writes.Where(message => message.LoggerName.Equals(typeof(DistributedSession).FullName, StringComparison.Ordinal)).Single(); 884var sessionMiddlewareLogMessage = sink.Writes.Where(message => message.LoggerName.Equals(typeof(SessionMiddleware).FullName, StringComparison.Ordinal)).Single(); 942var sessionLogMessages = sink.Writes.Where(message => message.LoggerName.Equals(typeof(DistributedSession).FullName, StringComparison.Ordinal)).ToList(); 950var sessionMiddlewareLogs = sink.Writes.Where(message => message.LoggerName.Equals(typeof(SessionMiddleware).FullName, StringComparison.Ordinal)).ToList(); 1009var sessionLogMessages = sink.Writes.Where(message => message.LoggerName.Equals(typeof(DistributedSession).FullName, StringComparison.Ordinal)).ToList(); 1073var sessionLogMessages = sink.Writes.Where(message => message.LoggerName.Equals(typeof(DistributedSession).FullName, StringComparison.Ordinal)).ToList();
Microsoft.AspNetCore.Shared.Tests (16)
PropertyHelperTest.cs (8)
219var helper1 = Assert.Single(PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo()).Where(prop => prop.Name == "IntProp")); 220var helper2 = Assert.Single(PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo()).Where(prop => prop.Name == "StringProp")); 238var propAHelper = Assert.Single(helpers.Where(h => h.Name == "PropA")); 239var propBHelper = Assert.Single(helpers.Where(h => h.Name == "PropB")); 258var propAHelper = Assert.Single(helpers.Where(h => h.Name == "PropA")); 259var propBHelper = Assert.Single(helpers.Where(h => h.Name == "PropB")); 278var propAHelper = Assert.Single(helpers.Where(h => h.Name == "PropA")); 279var propBHelper = Assert.Single(helpers.Where(h => h.Name == "PropB"));
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
233.Where(m => m.Name.Equals("StartAsTask", StringComparison.Ordinal));
src\Shared\PropertyActivator\PropertyActivator.cs (2)
86.Where((property) => 97properties = properties.Where(property => property.SetMethod is { IsPublic: true });
src\Shared\SecurityHelper\SecurityHelper.cs (1)
42newPrincipal.AddIdentities(existingPrincipal.Identities.Where(i => i.IsAuthenticated || i.Claims.Any()));
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
HubConnectionTests.cs (1)
2736var changeLog = Assert.Single(TestSink.Writes.Where(w => w.EventId.Name == "UserNameChanged"));
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Internal\Protocol\CompositeTestBinder.cs (1)
18_hubMessages = hubMessages.Where(IsBindableMessage).ToArray();
Microsoft.AspNetCore.SignalR.Core (4)
HubOptionsSetup.cs (1)
35if (hubProtocol.GetType().CustomAttributes.Where(a => a.AttributeType.FullName == "Microsoft.AspNetCore.SignalR.Internal.NonDefaultHubProtocolAttribute").Any())
Internal\HubReflectionHelper.cs (1)
17return methods.Except(excludedInterfaceMethods).Where(IsHubMethod);
Internal\TypedClientBuilder.cs (1)
149paramTypes.Where(p => p.IsGenericParameter).Select(p => p.Name).Distinct().ToArray();
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
233.Where(m => m.Name.Equals("StartAsTask", StringComparison.Ordinal));
Microsoft.AspNetCore.SignalR.Tests (9)
HubConnectionHandlerTests.ClientResult.cs (2)
96Assert.Single(TestSink.Writes.Where(write => write.EventId.Name == "ErrorDispatchingHubEvent")); 127Assert.Single(TestSink.Writes.Where(write => write.EventId.Name == "ErrorDispatchingHubEvent"));
HubConnectionHandlerTests.cs (7)
499var exceptionLog = TestSink.Writes.Where(w => string.Equals(w.LoggerName, "Microsoft.AspNetCore.SignalR.HubConnectionHandler") && 529var exceptionLog = TestSink.Writes.Where(w => string.Equals(w.LoggerName, "Microsoft.AspNetCore.SignalR.HubConnectionHandler") && 580var exceptionLog = TestSink.Writes.Where(w => string.Equals(w.LoggerName, "Microsoft.AspNetCore.SignalR.HubConnectionHandler") && 3958Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && 3983Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && 4158Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && 4195Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
Microsoft.AspNetCore.SignalR.Tests.Utils (2)
src\Shared\SignalR\VerifyNoErrorScope.cs (2)
36var results = _sink.GetLogs().Where(w => w.Write.LogLevel >= LogLevel.Error).ToList(); 40results = results.Where(w => !_expectedErrorsFilter(w.Write)).ToList();
Microsoft.AspNetCore.StaticFiles (2)
HtmlDirectoryFormatter.cs (2)
129foreach (var subdir in contents.Where(info => info.IsDirectory)) 165foreach (var file in contents.Where(info => !info.IsDirectory))
Microsoft.AspNetCore.Tests (6)
WebApplicationTests.cs (6)
1753Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IConfigureOptions<LoggerFactoryOptions>))); 1755Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment))); 1756Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IOptionsChangeTokenSource<HostFilteringOptions>))); 1757Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IServer))); 1758Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(EndpointDataSource))); 1779Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment)));
Microsoft.Build (57)
BackEnd\BuildManager\BuildManager.cs (2)
2011.Where(node => node.ProjectReferences.All(projectReference => finishedNodes.Contains(projectReference))) 3179LogErrorAndShutdown(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("InputCacheFilesDoNotExist", string.Join(";", inputCacheFiles.Where(f => !File.Exists(f)))));
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
377.Where(
BackEnd\Components\RequestBuilder\AssemblyLoadsTracker.cs (1)
73foreach (AssemblyLoadsTracker tracker in s_instances.Where(t => t._appDomain == appDomain))
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (4)
480.Where(i => !excludesUnescapedForComparison.Contains(((IItem)i).EvaluatedInclude.NormalizeForPathComparison())) 489var metadataToRemove = item.MetadataNames.Where(name => !keepMetadata.Contains(name)); 500var metadataToRemove = item.MetadataNames.Where(name => removeMetadata.Contains(name)); 629return group.Where(item => metadataSet.Contains(matchOnMetadata.Select(m => item.GetMetadataValue(m)))).ToList();
BackEnd\Components\RequestBuilder\Lookup.cs (2)
849List<string> metadataToRemove = new List<string>(itemToModify.Metadata.Where(m => modificationsToApply[m.Name].Remove).Select(m => m.Name)); 1095var metadataToRemove = new List<string>(_modifications.Keys.Where(m => other[m].Remove));
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
1238foreach (var proxyMapping in proxyTargetMapping.Where(kvp => kvp.Value != null))
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (1)
228.Where(t => t.info.IsClass && t.info.IsPublic && !t.info.IsAbstract && typeof(SdkResolver).IsAssignableFrom(t.type))
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (2)
44IList<Type> checkTypes = availableTypes.Where(t => typeof(Check).IsAssignableFrom(t)).ToArray(); 60foreach (Exception? unrolledEx in ex.LoaderExceptions.Where(e => e != null).Prepend(ex))
BuildCheck\OM\ParsedItemsCheckData.cs (1)
22return items.Where(i =>
BuildEnvironmentHelper.cs (1)
299.Where(i => i.Version.Major == v.Major && FileSystems.Default.DirectoryExists(i.Path))
Construction\Solution\SolutionProjectGenerator.cs (5)
817foreach (string targetName in _targetNames.Where(i => !traversalInstance.Targets.ContainsKey(i))) 831foreach (string targetName in _targetNames.Where(i => !traversalInstance.Targets.ContainsKey(i))) 1237foreach (string targetName in _targetNames.Where(i => !metaprojectInstance.Targets.ContainsKey(i))) 1257foreach (string targetName in _targetNames.Where(i => !metaprojectInstance.Targets.ContainsKey(i))) 1269foreach (string targetName in _targetNames.Where(i => !metaprojectInstance.Targets.ContainsKey(i)))
CopyOnWriteDictionary.cs (1)
221return _backing.Where(predicate);
Definition\Project.cs (7)
59private static readonly char[] s_invalidGlobChars = FileUtilities.InvalidFileNameChars.Where(c => c != '*' && c != '?' && c != '/' && c != '\\' && c != ':').ToArray(); 2621ImmutableArray<ItemSpecFragment> includeGlobFragments = includeItemspec.Fragments.Where(f => f is GlobFragment && f.TextFragment.IndexOfAny(s_invalidGlobChars) == -1).ToImmutableArray(); 2756.Where(itemElement => 2771return itemElements.Where(i => i.ItemType.Equals(itemType)).ToList(); 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)
618var siblingItems = _project.Items.Where(i => i._xml == _xml);
Definition\ToolsetConfigurationReader.cs (1)
248.Where(path => !string.IsNullOrEmpty(path));
Definition\ToolsetReader.cs (1)
200foreach (var d in Directory.GetDirectories(xbuildToolsetsDir).Where(d => r.IsMatch(d)))
Evaluation\Expander.cs (2)
3602IEnumerable<MethodInfo> methods = _receiverType.GetMethods(_bindingFlags).Where(m => m.Name.Equals(_methodMethodName) && m.GetParameters().Length == args.Length); 5561members = _receiverType.GetMethods(bindingFlags).Where(m => string.Equals(m.Name, _methodMethodName, StringComparison.OrdinalIgnoreCase));
Evaluation\LazyItemEvaluator.IncludeOperation.cs (1)
79? itemsFromExpression.Where(item => !excludeTester.Value(item.EvaluatedInclude))
Evaluation\LazyItemEvaluator.UpdateOperation.cs (1)
119var nonItemReferenceFragments = _itemSpec.Fragments.Where(f => !(f is ItemSpec<P, I>.ItemExpressionFragment)).ToArray();
Evaluation\Preprocessor.cs (3)
137foreach (ResolvedImport resolvedImport in _project.Imports.Where(i => i.ImportingElement.ImplicitImportLocation != ImplicitImportLocation.None)) 180foreach (ResolvedImport import in implicitImports.Where(i => i.ImportingElement.ImplicitImportLocation == ImplicitImportLocation.Top)) 206foreach (var import in implicitImports.Where(i => i.ImportingElement.ImplicitImportLocation == ImplicitImportLocation.Bottom))
Evaluation\Profiler\ProfilerResultPrettyPrinter.cs (2)
49var evaluationPasses = profiledLocations.Where(l => l.Key.IsEvaluationPass) 52var orderedLocations = profiledLocations.Where(l => !l.Key.IsEvaluationPass)
FileMatcher.cs (6)
135? allEntriesForPath.Where(o => IsFileNameMatch(o, pattern)) 253.Where(o => IsFileNameMatch(o, pattern)) 333files = files.Where(o => IsFileNameMatch(o, filespec)); 394directories = directories.Where(o => IsFileNameMatch(o, pattern)); 1070return files.Where(o => MatchFileRecursionStep(recursionState, o)); 2611? listOfFiles.SelectMany(list => list).Where(f => !resultsToExclude.Contains(f)).ToArray()
Graph\ProjectInterpretation.cs (1)
531.Where(t => !t.SkipIfNonexistent || projectGraphNode.ProjectInstance.Targets.ContainsKey(t.Target))
Instance\ProjectItemInstance.cs (2)
1451.Where(metadatum => string.IsNullOrEmpty(destinationItem.GetMetadata(metadatum.Name))) 1894.Where(item => !FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(item.Key))
Instance\TaskRegistry.cs (1)
672.Where(tp => RegisteredTaskIdentity.RegisteredTaskIdentityComparer.IsPartialMatch(taskIdentity, tp.Key))
Logging\BinaryLogger\BuildEventArgsWriter.cs (1)
298Write(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)));
Logging\ParallelLogger\ParallelConsoleLogger.cs (1)
240WriteEnvironment(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
Logging\ProfilerLogger.cs (2)
162.Where(key => key.Kind == EvaluationLocationKind.Glob) 225foreach (var prunedPair in aggregatedLocations.Where(pair =>
Logging\SerialConsoleLogger.cs (1)
113WriteEnvironment(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
Utilities\EngineFileUtilities.cs (1)
217var excludeSpecsUnescaped = excludeSpecsEscaped?.Where(IsValidExclude).Select(i => EscapingUtilities.UnescapeAll(i)).ToList();
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 (2)
CommandLineSwitches_Tests.cs (1)
1547.Cast<DictionaryEntry>().Where(i => i.Key is string && ((string)i.Key).StartsWith("HelpMessage_"))
XMake_Tests.cs (1)
2768.Where(d =>
Microsoft.Build.Engine.OM.UnitTests (38)
BuildEnvironmentHelper.cs (1)
299.Where(i => i.Version.Major == v.Major && FileSystems.Default.DirectoryExists(i.Path))
Construction\ConstructionEditing_Tests.cs (1)
1117var itemUpdateElements = project.Items.Where(i => i.UpdateLocation != null);
Construction\ProjectRootElement_Tests.cs (1)
528string toolsPath = projectCollection.Toolsets.Where(toolset => (string.Equals(toolset.ToolsVersion, ObjectModelHelpers.MSBuildDefaultToolsVersion, StringComparison.OrdinalIgnoreCase))).First().ToolsPath;
Definition\EditingElementsReferencedByOrReferences_Tests.cs (12)
35ProjectItem item = project.GetItems("I").Where(i => i.UnevaluatedInclude == "X").First(); 69ProjectItem item = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 98ProjectItem item = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 137ProjectItem item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 140ProjectItem item2 = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 188ProjectItem item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 210item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 212ProjectItem item2 = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 240ProjectItem item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 244ProjectItem item2 = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 264item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 266item2 = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First();
Definition\Project_Tests.cs (1)
4350var itemsOfValue = p.Items.Where(i => i.EvaluatedInclude.Equals(itemValue));
Definition\ProjectItem_Tests.cs (11)
2422var items = project.ItemsIgnoringCondition.Where(i => i.ItemType.Equals("I2")); 2449var items = project.ItemsIgnoringCondition.Where(i => i.ItemType.Equals("I2")); 2481var items = project.ItemsIgnoringCondition.Where(i => i.ItemType.Equals("I2")); 2526var items = project.ItemsIgnoringCondition.Where(i => i.ItemType.Equals("I2")); 2558var items = project.ItemsIgnoringCondition.Where(i => i.ItemType.Equals("I2")); 2595var items = project.ItemsIgnoringCondition.Where(i => i.ItemType.Equals("I2")); 2625var items = project.ItemsIgnoringCondition.Where(i => i.ItemType.Equals("I2")); 2656IEnumerable<ProjectItem> items = project.ItemsIgnoringCondition.Where(i => i.ItemType.Equals("I2")); 2685IEnumerable<ProjectItem> items = project.ItemsIgnoringCondition.Where(i => i.ItemType.Equals("I3")); 3383var items = ObjectModelHelpers.GetItemsFromFragment(content, true).Where(i => i.ItemType.Equals("to")).ToArray(); 3662.Where(i => i.ItemType.Equals("i"))
Definition\ProtectImports_Tests.cs (6)
525IEnumerable<ProjectItem> items = project.GetItems(ItemType).Where(pi => pi.IsImported); 542IEnumerable<ProjectMetadata> metadatum = item.Metadata.Where(m => m.Name == ImportedMetadataName); 559IEnumerable<ProjectMetadata> metadatum = item.Metadata.Where(m => m.Name == NonOverridableMetadataName); 576IEnumerable<ProjectMetadata> metadatum = item.Metadata.Where(m => m.Name == OverridableMetadataName); 632IEnumerable<ProjectItem> items = project.GetItems(ItemType).Where(pi => !pi.IsImported); 649IEnumerable<ProjectMetadata> metadatum = item.Metadata.Where(m => m.Name == ProjectMetadataName);
ObjectModelRemoting\LinkedConstructionModify_Tests.cs (3)
85ViewValidation.VerifyMetadata(itemMetadata, (k) => itemWithMetadata1.View.Metadata.Where((md) => md.Name == k).FirstOrDefault().Value); 707ViewValidation.VerifyMetadata(itemMetadata, (k) => itemWithMetadata1.View.Metadata.Where((md) => md.Name == k).FirstOrDefault().Value); 708ViewValidation.VerifyMetadata(itemMetadata, (k) => itemWithMetadata2.View.Metadata.Where((md) => md.Name == k).FirstOrDefault().Value);
ObjectModelRemoting\LinkedSpecialCasesScenarios.cs (2)
105var existingItemGroupList = sourceProject.AllChildren.OfType<ProjectItemGroupElement>().Where((ig) => ig.Label == "Group1").ToList(); 157var existingItemGroupList = sourceProject.AllChildren.OfType<ProjectItemGroupElement>().Where((ig) => ig.Label == "Group1").ToList();
Microsoft.Build.Engine.UnitTests (71)
BackEnd\BinaryTranslator_Tests.cs (2)
252.Where(a => !a.FullName!.StartsWith("MSBuildTaskHost", StringComparison.CurrentCultureIgnoreCase)) 254.Where(BuildExceptionSerializationHelper.IsSupportedExceptionType)
BackEnd\BuildManager_Tests.cs (1)
1004var deferredMessages = logger.BuildMessageEvents.Where(e => e.Message.StartsWith("deferred")).ToArray();
BackEnd\LoggingConfigurationTelemetry_Tests.cs (1)
43telemetry.GetProperties().Where(kv => kv.Value != bool.FalseString).ShouldBeEmpty();
BackEnd\Lookup_Tests.cs (8)
178Assert.Equal(2, group.Where(item => item.EvaluatedInclude == "a1").Count()); 180Assert.Single(group.Where(item => item.EvaluatedInclude == "a2")); 190Assert.Equal(2, group.Where(item => item.EvaluatedInclude == "a1").Count()); 192Assert.Single(group.Where(item => item.EvaluatedInclude == "a2")); 230Assert.Equal(4, group.Where(item => item.EvaluatedInclude == "a1").Count()); 233Assert.Single(group.Where(item => item.EvaluatedInclude == "a2")); 243Assert.Equal(4, group.Where(item => item.EvaluatedInclude == "a1").Count()); 246Assert.Single(group.Where(item => item.EvaluatedInclude == "a2"));
BackEnd\SdkResultOutOfProc_Tests.cs (1)
201return targetresult.Items.Where(i => i.GetMetadata("Type").Equals(type, StringComparison.OrdinalIgnoreCase))
Construction\SolutionProjectGenerator_Tests.cs (24)
1529Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Build", StringComparison.OrdinalIgnoreCase))); 1530Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Clean", StringComparison.OrdinalIgnoreCase))); 1531Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Rebuild", StringComparison.OrdinalIgnoreCase))); 1532Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Publish", StringComparison.OrdinalIgnoreCase))); 1534ProjectTargetInstance buildTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Build", StringComparison.OrdinalIgnoreCase)).First().Value; 1535ProjectTargetInstance cleanTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Clean", StringComparison.OrdinalIgnoreCase)).First().Value; 1536ProjectTargetInstance rebuildTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Rebuild", StringComparison.OrdinalIgnoreCase)).First().Value; 1537ProjectTargetInstance publishTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Publish", StringComparison.OrdinalIgnoreCase)).First().Value; 1540Assert.Null(buildTarget.Tasks.Where( 1544Assert.Equal("Clean", cleanTarget.Tasks.Where( 1548Assert.Equal("Rebuild", rebuildTarget.Tasks.Where( 1552Assert.Equal("Publish", publishTarget.Tasks.Where( 1557Assert.Equal("@(ProjectReference)", buildTarget.Tasks.Where( 1561Assert.Equal("@(ProjectReference->Reverse())", cleanTarget.Tasks.Where( 1565Assert.Equal("@(ProjectReference)", rebuildTarget.Tasks.Where( 1569Assert.Equal("@(ProjectReference)", publishTarget.Tasks.Where( 2355Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "One", StringComparison.OrdinalIgnoreCase))); 2359Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Two", StringComparison.OrdinalIgnoreCase))); 2360Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Three", StringComparison.OrdinalIgnoreCase))); 2361Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Four", StringComparison.OrdinalIgnoreCase))); 2365Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Build", StringComparison.OrdinalIgnoreCase))); 2369Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Five", StringComparison.OrdinalIgnoreCase))); 2370Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Rebuild", StringComparison.OrdinalIgnoreCase))); 2374Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Six", StringComparison.OrdinalIgnoreCase)));
Evaluation\EvaluationLogging_Tests.cs (1)
129var allBuildEvents = firstEvaluationLogger.AllBuildEvents.Where(be => be is ProjectEvaluationStartedEventArgs || be is ProjectEvaluationFinishedEventArgs).ToList();
Evaluation\Evaluator_Tests.cs (5)
1928IEnumerable<ProjectProperty> nonImportedProperties = project.Properties.Where(property => property.Xml == null); 2086foreach (ProjectProperty property in project.AllEvaluatedProperties.Where(property => property.Xml == null)) 2092IEnumerable<ProjectProperty> nonImportedProperties = project.Properties.Where(property => property.Xml == null); 2113IEnumerable<ProjectProperty> restOfAllEvaluatedProperties = project.AllEvaluatedProperties.Where(property => property.Xml != null); 2216IEnumerable<ProjectProperty> nonImportedProperties = project.Properties.Where(property => property.Xml == null);
Evaluation\ItemEvaluation_Tests.cs (10)
67var itemsForI = items.Where(i => i.ItemType == "i").ToList(); 76var itemsForI2 = items.Where(i => i.ItemType == "i2").ToList(); 116var itemsForI = items.Where(i => i.ItemType == "i").ToList(); 119var itemsForI2 = items.Where(i => i.ItemType == "i2").ToList(); 208var itemsForI = items.Where(i => i.ItemType == "i").ToList(); 219var itemsForI2 = items.Where(i => i.ItemType == "i2").ToList(); 504var i1Items = items.Where(i => i.ItemType == "i1").ToList(); 518var i2Items = items.Where(i => i.ItemType == "i2").ToList(); 522var i3Items = items.Where(i => i.ItemType == "i3").ToList(); 525var i_condItems = items.Where(i => i.ItemType == "i_cond").ToList();
EvaluationProfiler_Tests.cs (11)
152Assert.Single(profiledElements.Where(location => location.EvaluationPass == EvaluationPass.InitialProperties)); 155Assert.Single(profiledElements.Where(location => location.ElementName == "PropertyGroup")); 156Assert.Single(profiledElements.Where(location => location.ElementName == "appname")); 159Assert.Single(profiledElements.Where(location => location.ElementName == "ItemDefinitionGroup")); 160Assert.Single(profiledElements.Where(location => location.ElementName == "CSFile" & location.EvaluationPass == EvaluationPass.ItemDefinitionGroups)); 163Assert.Single(profiledElements.Where(location => location.ElementName == "ItemGroup")); 165Assert.Single(profiledElements.Where(location => location.ElementName == "Condition" & location.EvaluationPass == EvaluationPass.Items)); 170Assert.Single(profiledElements.Where(location => location.EvaluationPass == EvaluationPass.UsingTasks)); 174Assert.Single(profiledElements.Where(location => location.ElementName == "Target")); 199Assert.Single(profiledElements.Where(location => location.EvaluationPass == EvaluationPass.TotalGlobbing)); 224Assert.True(profiledElements.Where(e => e.IsEvaluationPass && e.EvaluationPass != EvaluationPass.TotalGlobbing && !e.Equals(totalEvaluation))
Graph\GraphLoadedFromSolution_tests.cs (2)
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);
Graph\GraphTestingUtilities.cs (3)
68.Where(p => p.ProjectType == ProjectInterpretation.ProjectType.InnerBuild && p.ProjectInstance.FullPath == outerBuild.ProjectInstance.FullPath) 138return graph.ProjectNodes.Where(node => node.ProjectInstance.FullPath.EndsWith(projectNum + ".proj")); 157.Where(p => p.ProjectType == ProjectInterpretation.ProjectType.InnerBuild && p.ProjectInstance.FullPath.Equals(outerBuild.ProjectInstance.FullPath))
Graph\ResultCacheBasedBuilds_Tests.cs (1)
452var cacheFilesForReferences = node.ProjectReferences.Where(r => outputCaches.ContainsKey(r)).Select(r => outputCaches[r]).ToArray();
ProjectCache\ProjectCacheTests.cs (1)
1480foreach (var node in graph.ProjectNodes.Where(n => referenceNumbers.Contains(GetProjectNumber(n))))
Microsoft.Build.Framework (1)
ProjectStartedEventArgs.cs (1)
386var validProperties = properties.Cast<DictionaryEntry>().Where(entry => entry.Key != null && entry.Value != null);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
IntegrationTests.cs (1)
47if (!vars.Where(kvp => kvp.Key == "RoslynCommandLineLogFile").Any())
Microsoft.Build.Tasks.Core (21)
AssemblyDependency\GenerateBindingRedirects.cs (2)
199.Where(e => e.Name.LocalName == "assemblyBinding"); 206.Where(e => e.Name.LocalName == "dependentAssembly");
AssemblyFoldersFromConfig.cs (1)
71.Where(platformFilter)
BuildEnvironmentHelper.cs (1)
299.Where(i => i.Version.Major == v.Major && FileSystems.Default.DirectoryExists(i.Path))
CopyOnWriteDictionary.cs (1)
221return _backing.Where(predicate);
FileMatcher.cs (6)
135? allEntriesForPath.Where(o => IsFileNameMatch(o, pattern)) 253.Where(o => IsFileNameMatch(o, pattern)) 333files = files.Where(o => IsFileNameMatch(o, filespec)); 394directories = directories.Where(o => IsFileNameMatch(o, pattern)); 1070return files.Where(o => MatchFileRecursionStep(recursionState, o)); 2611? listOfFiles.SelectMany(list => list).Where(f => !resultsToExclude.Contains(f)).ToArray()
GetSDKReferenceFiles.cs (1)
251IEnumerable<ITaskItem> filteredResolvedSDKReferences = ResolvedSDKReferences.Where(
NativeMethods.cs (1)
1412.Where(x => x % 2 == 0)
ResolveSDKReference.cs (4)
465ResolvedSDKReferences = sdkReferenceItems.Where(x => x.Resolved).Select(x => x.ResolvedItem).ToArray(); 521string[] unresolvedDependencyIdentities = dependentSDKs.Where(x => 531var resolvedReference = sdkReferenceItems.Where(y => String.Equals(y.SimpleName, simpleName, StringComparison.OrdinalIgnoreCase) && String.Equals(y.Version, sdkVersion, StringComparison.OrdinalIgnoreCase)).DefaultIfEmpty(null).FirstOrDefault(); 549return dependsOnSDK.Split(MSBuildConstants.SemicolonChar, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).Where(y => y.Length > 0).ToList<string>();
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (3)
176?? exportedTypes.Where(i => i.FullName != null).FirstOrDefault(type => type.FullName.Equals(taskName, StringComparison.OrdinalIgnoreCase) || type.FullName.EndsWith(taskName, StringComparison.OrdinalIgnoreCase)); 327.Where(i => i.NodeType != XmlNodeType.Comment && i.NodeType != XmlNodeType.Whitespace)) 409foreach (XAttribute attribute in codeElement.Attributes().Where(i => !i.IsNamespaceDeclaration))
WriteCodeFragment.cs (1)
482.Where(t => t.Length == positionalParameters.Count)
Microsoft.Build.Tasks.UnitTests (11)
Copy_Tests.cs (2)
2093var xaCopies = filesActuallyCopied.Where(f => f.Value.Name == xaPath).ToList(); 2100var xbCopies = filesActuallyCopied.Where(f => f.Value.Name == xbPath).ToList();
Hash_Tests.cs (1)
98.Where(g => g.Count() > 1)
MSBuild_Tests.cs (2)
1480.Where(p => p.ParentProjectBuildEventContext?.TaskId > 0) 1516.Where(p => p.ParentProjectBuildEventContext?.TaskId > 0)
ResourceManagement_Tests.cs (3)
27var filteredMessages = messages.Where(m => m.Message.StartsWith("Number of cores acquired: ")).ToArray(); 42var filteredMessages = messages.Where(m => m.Message.StartsWith("Number of cores acquired: ")).ToArray(); 69var filteredMessages = messages.Where(m => m.Message.StartsWith("Number of cores acquired: ")).ToArray();
RoslynCodeTaskFactory_Tests.cs (2)
210.Where(m => m.Message == "Compiling task source code") 763logLines.Where(l => l.Contains(dotnetPath)).Count().ShouldBe(1, log);
WriteCodeFragment_Tests.cs (1)
1181.Where(line => line.Length > 0 && !line.StartsWith(commentStart)));
Microsoft.Build.UnitTests.Shared (6)
EngineTestEnvironment.cs (2)
228var actualLoggerPairs = GetLoggers().Where(l => l.logger is not BinaryLogger).ToArray(); 229expectedLoggerPairs = expectedLoggerPairs.Where(l => l.logger is not BinaryLogger).ToArray();
EnvironmentProvider.cs (1)
65.Where(p => !Path.GetInvalidPathChars().Any(p.Contains))
ObjectModelHelpers.cs (3)
1093return string.Join(itemSeparator, project.Items.Where(i => i.ItemType.Equals(itemType)).Select(i => i.EvaluatedInclude)); 1797? nodes.Where(n => entryPoints.Contains(n.Key)).Select(n => n.Value.ProjectPath) 1798: nodes.Where(n => n.Value.IsRoot).Select(n => n.Value.ProjectPath);
Microsoft.Build.Utilities.Core (15)
AssemblyFoldersFromConfig.cs (1)
71.Where(platformFilter)
BuildEnvironmentHelper.cs (1)
299.Where(i => i.Version.Major == v.Major && FileSystems.Default.DirectoryExists(i.Path))
CopyOnWriteDictionary.cs (1)
221return _backing.Where(predicate);
FileMatcher.cs (6)
135? allEntriesForPath.Where(o => IsFileNameMatch(o, pattern)) 253.Where(o => IsFileNameMatch(o, pattern)) 333files = files.Where(o => IsFileNameMatch(o, filespec)); 394directories = directories.Where(o => IsFileNameMatch(o, pattern)); 1070return files.Where(o => MatchFileRecursionStep(recursionState, o)); 2611? listOfFiles.SelectMany(list => list).Where(f => !resultsToExclude.Contains(f)).ToArray()
MuxLogger.cs (1)
865Traits.LogAllEnvironmentVariables ? _buildStartedEvent.BuildEnvironment : _buildStartedEvent.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
ToolLocationHelper.cs (4)
472.Where<TargetPlatformSDK>(platformSDK => 526var targetPlatformMoniker = targetPlatforms.Where<TargetPlatformSDK>( 772return targetPlatforms.Where<TargetPlatformSDK>(platform => platform.Path != null).ToList<TargetPlatformSDK>(); 1422.Where(i => (minVersion == null || i.Version >= minVersion) && (maxVersion == null || i.Version < maxVersion))
ToolTask.cs (1)
1319.Where(path =>
Microsoft.Cci.Extensions (43)
Differs\ElementDifferenceFactory.cs (1)
47rules = rules.Where(r => _ruleFilter(r.Metadata));
Experimental\FilteredAssembly.cs (1)
431get { return _ns.Members.Where(m => !_filter.FilterNamespace(m)); }
Extensions\CSharp\CSharpCciExtensions.cs (4)
161foreach (var field in resolvedType.Fields.Where(f => !f.IsStatic)) 202foreach (var field in resolvedType.Fields.Where(f => !f.IsStatic)) 657return ((ITypeDefinition)method.ContainingType).ExplicitImplementationOverrides.Where(mi => mi.ImplementingMethod.Equals(method)).FirstOrDefault(); 865IEnumerable<InterfaceImplementation> foundInterfaces = typeDefinition.GetInterfaceImplementations().Select(metadataReader.GetInterfaceImplementation).Where(impl => metadataReader.GetToken(impl.Interface) == (int)interfaceImplementationToken);
Extensions\TypeExtensions.cs (1)
326}).Where(t => t != null);
Filters\BaselineDifferenceFilter.cs (1)
74return _ignoreDifferences.Where(i => !i.Value).Select(i => i.Key);
HostEnvironment.cs (2)
613paths = Enumerable.Concat(new List<string>() { coreAssemblyFile }, paths.Where(ai => !StringComparer.OrdinalIgnoreCase.Equals(ai, coreAssemblyFile))); 675identities = Enumerable.Concat(new List<AssemblyIdentity>() { coreIdentity }, identities.Where(ai => ai != coreIdentity));
Mappings\AssemblyMapping.cs (1)
60foreach (var ns in element.GetAllNamespaces().Where(this.Filter.Include))
Mappings\AttributesMapping.cs (2)
66return reference.Attributes.Where(Filter.Include); 70return attributes.Where(Filter.Include);
Mappings\NamespaceMapping.cs (1)
26foreach (var type in element.GetTypes(this.Settings.IncludeForwardedTypes).Where(this.Filter.Include))
Mappings\TypeMapping.cs (6)
42public IEnumerable<MemberMapping> Fields { get { return _members.Values.Where(m => m.Representative is IFieldDefinition); } } 43public IEnumerable<MemberMapping> Properties { get { return _members.Values.Where(m => m.Representative is IPropertyDefinition); } } 44public IEnumerable<MemberMapping> Events { get { return _members.Values.Where(m => m.Representative is IEventDefinition); } } 45public IEnumerable<MemberMapping> Methods { get { return _members.Values.Where(m => m.Representative is IMethodDefinition); } } 90foreach (var m in GetOnlyMembers(baseType).Where(this.Filter.Include)) 95foreach (var m in GetOnlyMembers(type).Where(this.Filter.Include))
Traversers\DifferenceTraverser.cs (1)
67differences = differences.Where(_filter.Include);
Traversers\MappingsTypeMemberTraverser.cs (6)
44assemblies = assemblies.Where(this.DiffFilter.Include); 63namespaces = namespaces.Where(this.DiffFilter.Include); 82types = types.Where(this.DiffFilter.Include); 92Visit(type.Methods.Where(m => ((IMethodDefinition)m.Representative).IsConstructor)); 95Visit(type.Methods.Where(m => !((IMethodDefinition)m.Representative).IsConstructor)); 101members = members.Where(this.DiffFilter.Include);
Traversers\SimpleTypeMemberTraverser.cs (6)
38namespaces = namespaces.Where(_filter.Include); 39namespaces = namespaces.Where(ns => ns.GetTypes(this.IncludeForwardedTypes).Any(_filter.Include)); 58types = types.Where(_filter.Include); 73Visit(type.Methods.Where(m => m.IsConstructor)); 76Visit(type.Methods.Where(m => !m.IsConstructor)); 101members = members.Where(_filter.Include);
Writers\CSharp\CSDeclarationWriter.Attributes.cs (1)
109attributes = attributes.Where(IncludeAttribute);
Writers\CSharp\CSDeclarationWriter.Methods.cs (1)
444var constructors = baseType.Methods.Where(
Writers\CSharp\CSDeclarationWriter.Types.cs (1)
97IEnumerable<ITypeReference> interfaces = type.Interfaces.Where(IncludeBaseType).OrderBy(t => GetTypeName(t), StringComparer.OrdinalIgnoreCase);
Writers\CSharp\CSharpWriter.cs (7)
115Visit(namespaces.Where(_currentTypeListFilter.Include)); 138types = types.Where(t => ConditionalTypeLists.Any(c => c.Filter.Include(t) == !firstPass)); 170var constructors = type.Methods.Where(m => m.IsConstructor && Filter.Include(m)); 223var includedVisibleFields = fields.Where(f => _cciFilter.Include(f)); 226var excludedFields = fields.Except(includedVisibleFields).Where(f => !f.IsStatic); 230var genericTypedFields = excludedFields.Where(f => f.Type.UnWrap().IsGenericParameter()); 233IFieldDefinition fieldType = new DummyPrivateField(parentType, genericField.Type, genericField.Name.Value, genericField.Attributes.Where(a => !a.FullName().EndsWith("NullAttribute")), genericField.IsReadOnly);
Microsoft.CodeAnalysis (29)
CodeGen\CompilationTestData.cs (1)
81var methodsByName = map.Where(p => p.Value.Method != null).ToImmutableDictionary();
DiagnosticAnalyzer\AnalysisResultBuilder.cs (3)
395diagnostics = diagnostics.Where(d => !currentDiagnostics.Contains(d)); 544var diagnostics = diagnosticsByAnalyzer.Value.Where(shouldInclude).ToImmutableArray(); 574var diagnostics = diagnosticsByAnalyzer.Value.Where(shouldInclude).ToImmutableArray();
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
712return cb.DescendantNodesAndSelf(descendIntoChildren: filter).Where(filter);
Emit\EditAndContinue\DefinitionMap.cs (1)
59.Where(edit => !edit.Instrumentation.IsEmpty)
FileSystem\PathUtilities.cs (1)
637pathParts = pathParts.Where(s => s != ThisDirectory).ToArray();
InternalUtilities\EnumerableExtensions.cs (1)
348return source.Where((Func<T?, bool>)s_notNullTest)!;
NativePdbWriter\PdbWriter.cs (1)
782.Where(kvp => !_documentIndex.ContainsKey(kvp.Value))
PEWriter\MetadataWriter.PortablePdb.cs (1)
795.Where(kvp => !_documentIndex.ContainsKey(kvp.Value))
PEWriter\PeWriter.cs (1)
324.Where(m => m.Name == "CalculateChecksum" && m.GetParameters().Length == 2)
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
23var codeBlocks = executableCodeBlocks?.Where(c => c != null).AsImmutableOrEmpty() ?? ImmutableArray<SyntaxNode>.Empty;
Syntax\SeparatedSyntaxList.cs (1)
166return _list.Where(n => n.IsToken).Select(n => n.AsToken());
Syntax\SyntaxList`1.cs (1)
299return CreateList(this.Where(x => x != node).ToList());
Syntax\SyntaxNode.cs (12)
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()); 1257.Where(t => t.HasAnnotations(annotationKind)); 1266.Where(t => t.HasAnnotations(annotationKinds)); 1275.Where(t => t.HasAnnotation(annotation)); 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()); 1318.Where(tr => tr.HasAnnotations(annotationKind)); 1327.Where(tr => tr.HasAnnotations(annotationKinds)); 1336.Where(tr => tr.HasAnnotation(annotation));
Syntax\SyntaxNode.Iterators.cs (1)
20? DescendantNodesAndTokensImpl(span, descendIntoChildren, true, includeSelf).Where(e => e.IsNode).Select(e => e.AsNode()!)
TreeDumper.cs (2)
92var children = node.Children.Where(c => !skip(c)).ToList(); 267foreach (var child in currentNode.Children.Where(x => x != null).Reverse())
Microsoft.CodeAnalysis.CodeStyle (30)
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
175.Where(syntaxFacts.IsTypeDeclaration);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
638=> nodes.Where(n => n.FirstAncestorOrSelf<TConstructorDeclaration>() is null);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
637pathParts = pathParts.Where(s => s != ThisDirectory).ToArray();
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
348return source.Where((Func<T?, bool>)s_notNullTest)!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
45.Where(tuple => tuple.matchKind.IsBetterOrEqualMatchThan(matchKind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (1)
32=> cfg.DescendantOperations().Where(d => d?.Kind == operationKind).Cast<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (2)
371.Where(t => t.IsAbstractClass()) 597var matches = result.Where(kvp =>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
29: symbol.GetMembers(WellKnownMemberNames.Indexer).OfType<IPropertySymbol>().Where(p => p.IsIndexer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (4)
550return ((INamedTypeSymbol)symbol).GetMembers().OfType<IPropertySymbol>().Where(p => p.CanBeReferencedByName); 654var getAwaiters = potentialGetAwaiters.OfType<IMethodSymbol>().Where(x => !x.Parameters.Any()); 706.Where(x => x.DeclaredAccessibility == Accessibility.Public) 746.Where(x => x.DeclaredAccessibility == Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (3)
440return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within))); 505return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within))); 515return types.SelectMany(x => x.GetMembers(memberName).OfType<T>().Where(m => m.IsAccessibleWithin(within)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
99.Where(s => !s.IsAnonymousTypeProperty() && !s.IsTupleField());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
35? token.Parent.AncestorsAndSelf().Where(predicate)
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\AbstractSyntaxFormatting.cs (1)
42spansToFormat = new NormalizedTextSpanCollection(spans.Where(s_notEmpty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
111=> TokenStream.GetTriviaDataWithTokenPair(cancellationToken).Where(d => d.Item2.ContainsChanges);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
403.Where(e => e.Name.LocalName == "SymbolKind" && e.Value == "Method").ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (1)
69.Where(m => m.Parent is TTypeDeclarationSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
55var exteriorTrivia = leadingTrivia.Where(_syntaxFacts.IsDocumentationCommentExteriorTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
340.Where(t => !syntaxFacts.IsElastic(t)) 345.Where(t => !syntaxFacts.IsElastic(t))
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\BKTree.Builder.cs (1)
97var distinctValues = values.Where(v => v.Length > 0).Distinct(CaseInsensitiveComparison.Comparer).ToArray();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
24.Where(f => f.HasConstantValue)
Microsoft.CodeAnalysis.CodeStyle.Fixes (25)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (3)
128.Where(w => GetXmlElementLocalName(w) == nodeName) 137.Where(w => GetXmlElementLocalName(w) == nodeName) 147.Where(nameAttributes => nameAttributes.Count == 1)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (4)
28.Where(f => !f.IsImplicitlyDeclared) 29.Where(f => includeMemberType(f.Type)) 34.Where(p => !p.IsImplicitlyDeclared && p.Parameters.Length == 0 && p.GetMethod != null) 35.Where(p => includeMemberType(p.Type))
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
79.Where(group => group.Key is not null)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
789foreach (var memberDecl in newRoot.DescendantNodes().Where(n => n.HasAnnotation(s_memberAnnotation))) 834.Where(n => n.HasAnnotation(s_newLocalDeclarationStatementAnnotation) ||
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
50var upgradeableProjects = solution.Projects.Where(p => CanUpgrade(p, language, newVersion)).AsImmutable();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
174var leadingTrivia = node.GetLeadingTrivia().Where(trivia => !trivia.IsDirective);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
56var nodes = root.DescendantNodesAndSelf(OverlapsWithSpan).Where(OverlapsWithSpan);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
166var nodesToVerify = nodesBySemanticBoundary.Where(group => group.Skip(1).Any()).Flatten().ToSet();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
507.Where(field => !field.IsStatic)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (4)
143var filteredImports = newImports.Where(i => !HasExistingImport(i, containers, globalImports)).ToArray(); 146var usingDirectives = filteredImports.OfType<TUsingOrAliasSyntax>().Where(IsSimpleUsing).ToArray(); 147var staticUsingDirectives = filteredImports.OfType<TUsingOrAliasSyntax>().Where(IsStaticUsing).ToArray(); 148var aliasDirectives = filteredImports.OfType<TUsingOrAliasSyntax>().Where(IsAlias).ToArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (2)
40firstToken.LeadingTrivia.Where(t => IsDocCommentOrElastic(syntaxFacts, t))); 46firstToken.LeadingTrivia.Where(t => !IsDocCommentOrElastic(syntaxFacts, t)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
81var filteredCandidates = filter != null ? candidates.Where(filter) : candidates;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
78return types.Where(filterUnusable ? IsUsableTypeFunc : s_isNotNull)
Microsoft.CodeAnalysis.CSharp (6)
Compiler\MethodCompiler.cs (2)
2218if (body1?.DescendantNodesAndSelf().Where(n => (object)n == _id).Any() == true || 2219body2?.DescendantNodesAndSelf().Where(n => (object)n == _id).Any() == true)
FlowAnalysis\CSharpDataFlowAnalysis.cs (2)
392return ImmutableArray.CreateRange(data.Where(s => s.CanBeReferencedByName).OrderBy(s => s, LexicalOrderSymbolComparer.Instance).GetPublicSymbols()); 397return ImmutableArray.CreateRange(data.Where(s => s.CanBeReferencedByName).OrderBy(s => s, LexicalOrderSymbolComparer.Instance).Select(p => p.GetPublicSymbol()));
FlowAnalysis\FlowAnalysisPass.cs (1)
90IEnumerable<Diagnostic> getErrorsOnly(IEnumerable<Diagnostic> diags) => diags.Where(d => d.Severity == DiagnosticSeverity.Error);
Syntax\SyntaxNodeRemover.cs (1)
435.Where(tr => tr.IsDirective)
Microsoft.CodeAnalysis.CSharp.CodeStyle (15)
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
83var nonGlobalUsings = compilationUnit.Usings.Where(u => u.GlobalKeyword == default);
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
236.Where(t => t.Kind() != SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
72.Where(m => IsTwoArgumentSliceLikeMethod(m))
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (3)
29.Where(p => IsPublicInstance(p) && 130.Where(p => p.IsIndexer && 147.Where(m => IsPublicInstance(m) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (3)
38block.CloseBraceToken.LeadingTrivia.Where(t => !t.IsWhitespaceOrEndOfLine())); 53var leadingDirectives = statement.GetLeadingTrivia().Where(IsAnyCodeDirective).ToImmutableArray(); 54var closeBraceLeadingDirectives = block.CloseBraceToken.LeadingTrivia.Where(IsAnyCodeDirective).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaListExtensions.cs (3)
21.Where(t => t.Kind() == SyntaxKind.EndOfLineTrivia) 28.Where(t => t.IsRegularComment()) 38.Where(t => t is (kind: SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia or SyntaxKind.WhitespaceTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
255var originalIdentifierNodes = originalLambdaBody.DescendantNodes().OfType<IdentifierNameSyntax>().Where(node => paramNames.Contains(node.Identifier.ValueText)); 261var replacedIdentifierNodes = replacedLambdaBody.DescendantNodes().OfType<IdentifierNameSyntax>().Where(node => paramNames.Contains(node.Identifier.ValueText));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
301.Where(n => n is IdentifierNameSyntax id && id.Identifier.ValueText.Equals(identifier.ValueText))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (17)
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\ConvertToRecord\ConvertToRecordEngine.cs (1)
108.Where(field => !field.IsConst && !field.IsStatic)
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (1)
42var docCommentNodes = leadingTrivia.Where(f => f.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia));
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
161var expressionTriviaWithoutEndOfLine = expressionTrivia.Where(t => !t.IsKind(SyntaxKind.EndOfLineTrivia));
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
195.Where(u => u.GlobalKeyword == default) 199var compilationUnitWithoutUsings = compilationUnit.WithUsings([.. compilationUnit.Usings.Where(u => u.GlobalKeyword != default)]);
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
120.Where(a => a.Initializer?.ElementValues.FirstOrDefault()?.Syntax.SpanStart == diagnostic.Location.SourceSpan.Start)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
195=> declaration.ChildTokens().Where(t => t.Kind() is SyntaxKind.OpenBraceToken or SyntaxKind.CloseBraceToken && t.IsMissing).Any();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
456newAttributeLists = attributeLists.Where(aList => aList != attributeList); 462var newAttributes = SeparatedList(attributes.Where(a => a != attributeToRemove));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
29.Where(f => f.Modifiers.Any(SyntaxKind.ConstKeyword)) 40.Where(f => f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)) 44.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.ConstKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
554.Where(p => p.IsIndexer && p.Parameters.Length > index); 764.Where(p => p.Name == name) 1329foreach (var sibling in initializerExpression.Expressions.Where(e => e.Kind() != SyntaxKind.ComplexElementInitializerExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (1)
48.Where(o => IsSymbolReferencedByOperation(o, symbol));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (8)
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
158var refDocument = workspace.Documents.Where(doc => doc.Id != originalDocumentId).SingleOrDefault();
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
207var diagnosticsFromAnalyzer = diagnostics.Where(d => d.Id == "SyntaxDiagnostic");
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (1)
364var editorconfig = solution.Projects.SelectMany(p => p.AnalyzerConfigDocuments.Where(a => a.FilePath == EditorconfigPath)).Single();
Interactive\NavigateTo\InteractiveNavigateToTests.cs (2)
589Assert.Single((await _aggregator.GetItemsAsync("Goo")).Where(x => x.Kind != "Method")); 593Assert.Single((await _aggregator.GetItemsAsync("Goo")).Where(x => x.Kind != "Method"));
NavigateTo\NavigateToTests.cs (2)
981Assert.Single((await _aggregator.GetItemsAsync("Goo")).Where(x => x.Kind != "Method")); 985Assert.Single((await _aggregator.GetItemsAsync("Goo")).Where(x => x.Kind != "Method"));
SymbolKey\SymbolKeyTestBase.cs (1)
179return list.Where(s =>
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (1)
192Assert.True(regex.GetGroupNames().Where(v => !int.TryParse(v, out _)).OrderBy(v => v).SequenceEqual(
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (39)
CodeGen\CodeGenAsyncMainTests.cs (1)
721var main = metadataReader.MethodDefinitions.Where(mh => getMethodName(mh) == "<Main>").Single();
CodeGen\CodeGenDeconstructTests.cs (7)
3635return tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == name).Single(); 3662return tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == name); 5472var firstX1 = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "x1").Single(); 5504var firstY = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "y").First(); 5509var secondY = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "y").ElementAt(1); 5535var firstX = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "x").First(); 5540var secondX = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "x").ElementAt(1);
CodeGen\CodeGenDynamicTests.cs (1)
137foreach (var src in excludeBinder == null ? _binderFactoriesSource : _binderFactoriesSource.Where(src => src.IndexOf(excludeBinder, StringComparison.Ordinal) == -1))
CodeGen\CodeGenFunctionPointersTests.cs (2)
3339var declarators = syntaxTree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Initializer!.Value.IsKind(SyntaxKind.AddressOfExpression)).ToArray(); 4921.Where(l => l.IsKind(SyntaxKind.DefaultLiteralExpression))
CodeGen\CodeGenInterpolatedString.cs (1)
46foreach (var token in tree.GetRoot().DescendantTokens().Where(t => t.Kind() != SyntaxKind.EndOfFileToken))
CodeGen\CodeGenOperators.cs (3)
5409ControlFlowGraph.Create((IMethodBodyOperation)model.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Calculate").Single())); 5699ControlFlowGraph.Create((IMethodBodyOperation)model.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Calculate").Single())); 5735ControlFlowGraph.Create((IMethodBodyOperation)model.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Calculate").Single()));
CodeGen\CodeGenTupleEqualityTests.cs (7)
1056.Where(e => e.Kind() == SyntaxKind.DefaultLiteralExpression); 1090.Where(e => e.Kind() == SyntaxKind.DefaultLiteralExpression); 1122.Where(e => e.Kind() == SyntaxKind.DefaultLiteralExpression); 1153.Where(e => e.Kind() == SyntaxKind.DefaultLiteralExpression); 1212.Where(e => e.Kind() == SyntaxKind.DefaultLiteralExpression); 1409.Where(e => e.Kind() == SyntaxKind.DelegateDeclaration); 1464.Where(e => e.Kind() == SyntaxKind.DelegateDeclaration);
CodeGen\CodeGenTupleTest.cs (17)
4024var result = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "result").Single(); 4156var node = nodes.OfType<MemberAccessExpressionSyntax>().Where(n => n.ToString() == "x.Rest").First(); 6068Assert.All(tuple8WithoutNames.GetMembers().OfType<IFieldSymbol>().Where(f => f.Name != "Rest").Select(f => f.Locations.FirstOrDefault()), 13974var nameofNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "nameof").Single(); 14245var m1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M1").Single(); 14261var m2 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M2").Single(); 14275var f1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F1").First(); 14289var p1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "P1").First(); 14306var m3 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M3").Single(); 14324var m4 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M4").Single(); 14331var m5 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M5").Single(); 14338var m6 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M6").Single(); 14433var e1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "E1").Single(); 14447var m5 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M5").Single(); 14454var v1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "v1").Single(); 14464var v2 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "v2").Single(); 24180var nodes = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "elem2").ToArray();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Emit\EditAndContinue\EditAndContinueTestBase.cs (4)
164rows.Where(r => r.Handle != default), 175rows.Where(r => r.Handle != default), 186handles.Where(h => h != default), 197handles.Where(h => h != default),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (265)
Attributes\AttributeTests_MarshalAs.cs (2)
34foreach (NamedTypeSymbol type in compilation.GlobalNamespace.GetMembers().Where(s => s.Kind == SymbolKind.NamedType)) 68foreach (NamedTypeSymbol type in compilation.GlobalNamespace.GetMembers().Where(s => s.Kind == SymbolKind.NamedType))
Attributes\AttributeTests_Synthesized.cs (1)
127var pid = (NamedTypeSymbol)comp.GlobalNamespace.GetMembers().Where(s => s.Name.StartsWith("<PrivateImplementationDetails>", StringComparison.Ordinal)).Single();
FlowAnalysis\FlowTestBase.cs (2)
218return GetSyntaxNodeList(tree).OfType<T>().Where(n => n.Span.Contains(offset)).FirstOrDefault(); 224return GetSyntaxNodeList(tree).OfType<T>().Where(n => n.Span.Contains(offset)).Last();
FlowAnalysis\FlowTests.cs (1)
5842var property = declarations.Select(d => model.GetDeclaredSymbol(d)).Where(p => p.ContainingSymbol.Name == "Program").Single();
FlowAnalysis\RegionAnalysisTests.cs (2)
4526var stmt1 = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<StatementSyntax>().Where(n => n.ToString() == "IntPtr p;").Single(); 4527var stmt2 = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<StatementSyntax>().Where(n => n.ToString().StartsWith(keyword)).First();
RefStructInterfacesTests.cs (59)
6628var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 6765var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single(); 6881var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 7013var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 7142var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 7472var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 7662var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 7881var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single(); 8075var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 8268var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 8441var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 8547var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 8931var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 9135var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 9331var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 9499var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 9714var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 9935var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 10150var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 10347var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 10442var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 10542var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 10739var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 10979var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single(); 11198var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 11422var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 12148var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 12416var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single(); 12661var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 12924var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 13191var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 13453var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 14151var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 14492var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 14854var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single(); 15205var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 15553var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 15732var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 15987var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 16758var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 16823var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 16888var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 16972var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 17060var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 17153var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 17250var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 17334var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 17655var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 17852var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 18075var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single(); 18275var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 18476var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 18652var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 18760var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single(); 19128var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 19299var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 19472var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 19624var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single(); 19966var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
Semantics\InlineArrayTests.cs (12)
2359var c = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "c").Single(); 2394var c = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "c").Single(); 2428var c = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "c").Single(); 2508var f = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").First(); 6033var f = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").First(); 6199var f = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").Last(); 8835var m3 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "M3").Single().Parent; 9203var m3 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "M3").Single(); 10547var f = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").Last(); 11291var f = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").Last(); 15208var f = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").ToArray(); 16495var m3 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "M3").First().Parent;
Semantics\OutVarTests.cs (24)
833return tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == name); 9702var d = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(id => id.Identifier.ValueText == "d").Single(); 10269var d = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(id => id.Identifier.ValueText == "d").Single(); 21370var e = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(id => id.Identifier.ValueText == "e").Single(); 32232var b = (IFieldSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single()); 32272var b = (IFieldSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single()); 32312var a = (IFieldSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "a").Single()); 32385var bDecl = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single(); 33506var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "x").Single(); 33694var z1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "z1").First(); 35179var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 35218var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 35262var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 35293var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 35332var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 35364var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 35400var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 35439var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 35469var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 35506var varType = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single(); 36323var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test3").Last(); 36416Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single())); 36498Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single())); 36571Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single()));
Semantics\ParamsCollectionTests.cs (7)
3596var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single(); 3886var node = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single(); 5893var f1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F1").Single(); 5895var f2 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F2").Single(); 5975var f1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F1").Single(); 5977var f2 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F2").Single(); 9072var parameterDecl = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.Identifier.ValueText == "paramsParameter").Single();
Semantics\PatternMatchingTestBase.cs (4)
27return GetPatternDeclarations(tree).Where(d => d.Identifier.ValueText == v); 37return tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Parent.Kind() == SyntaxKind.DeclarationPattern || p.Parent.Kind() == SyntaxKind.VarPattern); 42return GetVariableDeclarations(tree).Where(d => d.Identifier.ValueText == v); 62return tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == name);
Semantics\PatternMatchingTests.cs (29)
849var yRef = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).Single(); 1432var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 1433var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 1482var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 1483var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 1591var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 1592var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 1656var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 1657var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 1662var x2Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x2").ToArray(); 1663var x2Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x2").ToArray(); 1668var x3Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x3").ToArray(); 1669var x3Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x3").ToArray(); 1739var x2Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x2").ToArray(); 1740var x2Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x2").ToArray(); 1745var x3Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x3").ToArray(); 1746var x3Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x3").ToArray(); 2702var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 2703var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 2747var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 2748var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 2791var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 2792var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 2843var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 2844var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 3040var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 3041var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 3087var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 3088var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
Semantics\PatternMatchingTests_ListPatterns.cs (1)
3677.Where(p => p.IsKind(SyntaxKind.PropertyPatternClause));
Semantics\PatternMatchingTests_Scope.cs (73)
678var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single(); 679var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single(); 713tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, 719var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single(); 720var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 947var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single(); 948var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single(); 982tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, 988var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single(); 989var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 2222var yRef = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).ToArray(); 2358var yRef = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).ToArray(); 2421var yRef = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).ToArray(); 2486var yRef = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).Single(); 2556var yRef = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).Single(); 2712var yRef = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).ToArray(); 6525var d = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(id => id.Identifier.ValueText == "d").Single(); 6590var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single(); 6591var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single(); 6594var x4Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x4").Single(); 6595var x4Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x4").ToArray(); 6601var x6Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x6").Single(); 6602var x6Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x6").Single(); 6605var x8Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x8").Single(); 6606var x8Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x8").ToArray(); 6610var x14Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x14").ToArray(); 6611var x14Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x14").Single(); 6679var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single(); 6680var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single(); 6683var x4Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x4").Single(); 6684var x4Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x4").ToArray(); 6690var x6Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x6").Single(); 6691var x6Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x6").Single(); 6694var x8Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x8").Single(); 6695var x8Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x8").ToArray(); 6699var x14Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x14").ToArray(); 6700var x14Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x14").Single(); 6838var x2Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x2").ToArray(); 6839var x2Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x2").ToArray(); 6845var x3Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x3").Single(); 6846var x3Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x3").ToArray(); 6850var x4Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x4").Single(); 6851var x4Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x4").ToArray(); 6884bool success = model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, statement, out model); 6930var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single(); 6931var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 6936var d = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(id => id.Identifier.ValueText == "d").Single(); 10589var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray(); 10590var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 10597var x2Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x2").Single(); 10598var x2Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x2").Single(); 10601var x3Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x3").Single(); 10602var x3Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x3").Single(); 10605var x4Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x4").Single(); 10606var x4Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x4").ToArray(); 10612var x5Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x5").Single(); 10613var x5Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x5").ToArray(); 10617var x8Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x8").ToArray(); 10618var x8Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x8").ToArray(); 10627var x9Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x9").Single(); 10628var x9Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x9").Single(); 10631var x10Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x10").Single(); 10632var x10Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x10").Single(); 10635var x11Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x11").Single(); 10636var x11Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x11").ToArray(); 10640var x12Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x12").Single(); 10641var x12Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x12").ToArray(); 10685var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single(); 10686var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single(); 10720tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, 10726var x1Decl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single(); 10727var x1Ref = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray(); 12211var e = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(id => id.Identifier.ValueText == "e").Single();
Semantics\PatternMatchingTests3.cs (2)
1889var strDecl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(s => s.Identifier.ValueText == "str").ToArray(); 1893var arrDecl = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(s => s.Identifier.ValueText == "arr").ToArray();
Semantics\PatternSwitchTests.cs (6)
1515var sRef = tree.GetCompilationUnitRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "s").Single(); 1517var iRef = tree.GetCompilationUnitRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "i").Single(); 1519var s2Ref = tree.GetCompilationUnitRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "s2").Single(); 1521var i2Ref = tree.GetCompilationUnitRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "i2").Single(); 3254.Where(n => n.Identifier.ValueText == "q" && n.ToFullString().Contains("/*BIND*/")) 3285.Where(n => n.Identifier.ValueText == "q" && n.ToFullString().Contains("/*BIND*/"))
Semantics\PrimaryConstructorTests.cs (22)
1003var xs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray(); 1072var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1); 1300var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1); 1311var y = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").First(); 1324var test = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").First(); 1365var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 1411var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 1467var xs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray(); 1526var xs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray(); 1615var xs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray(); 1814var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 1854var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 1897var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 1967var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1); 2425var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2641var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2679var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2716var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2752var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 7794var p1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "p1").Single(); 8756var p1s = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "p1").ToArray(); 9162var p1s = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "p1").ToArray();
Semantics\RecordTests.cs (18)
21144var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1); 21374var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1); 21385var y = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").First(); 21398var test = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").First(); 21439var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 21485var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 21541var xs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray(); 21600var xs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray(); 21689var xs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray(); 21888var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 21925var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 21965var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 22000var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 22079var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1); 24643var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 24678var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 24712var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 24747var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
Microsoft.CodeAnalysis.CSharp.Features (53)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
314.Where(d => d.Identifier.ValueText == identifierName.Identifier.ValueText) 594var nodes = editor.OriginalRoot.DescendantNodes().Where(IsFixableNode).ToArray();
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (6)
158var unspecifiedNamedParameters = attributeNamedParameters.Where(p => !existingNamedParameters.Contains(p.Name)); 180parameterLists = parameterLists.Where(pl => IsValid(pl, existingNamedParameters)); 207argumentList.Arguments.Where(a => a.Span.End <= position) 208.Where(a => a.NameColon != null) 211argumentList.Arguments.Where(a => a.Span.End <= position) 212.Where(a => a.NameEquals != null)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (2)
189var fields = type.GetMembers().OfType<IFieldSymbol>().Where(f => f.IsConst).Where(f => f.HasConstantValue);
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (3)
89parameterLists = parameterLists.Where(pl => IsValid(pl, existingNamedParameters)); 92.Where(p => !existingNamedParameters.Contains(p.Name)) 144var existingArguments = argumentList.Arguments.Where(a => a.Span.End <= position && a.NameColon != null)
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
188.Where(b => b.OperatorToken.Kind() == SyntaxKind.EqualsToken)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
78p => p.NameColon?.Name.Identifier.ValueText).Where(s => !string.IsNullOrEmpty(s))!);
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
360attributes.Where(attribute => GetAttributeName(attribute) == attributeName)
Completion\KeywordRecommenders\FileKeywordRecommender.cs (1)
17.Where(s => s != SyntaxKind.FileKeyword && !SyntaxFacts.IsAccessibilityModifier(s))
Completion\KeywordRecommenders\RequiredKeywordRecommender.cs (1)
16private static readonly ISet<SyntaxKind> s_validModifiers = SyntaxKindSet.AllMemberModifiers.Where(s => s is not (SyntaxKind.RequiredKeyword or SyntaxKind.StaticKeyword or SyntaxKind.ReadOnlyKeyword or SyntaxKind.ConstKeyword)).ToSet();
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (2)
289.Where(statement => Equals(semanticModel.GetEnclosingSymbol( 299.Where(statement => statement.Kind() != SyntaxKind.LocalFunctionStatement).ToArray();
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
97var methodTargetingAttributes = typeDeclaration.AttributeLists.Where(list => list.Target?.Identifier.ValueText == "method");
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
198modifiers: [.. otherMethod.Modifiers.Where(m => m.Kind() is SyntaxKind.AsyncKeyword or SyntaxKind.UnsafeKeyword)],
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
149var throwExpressionsAndStatements = member.DescendantNodes().Where(n => n.Kind() is SyntaxKind.ThrowExpression or SyntaxKind.ThrowStatement);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
843var oldUsingDeclarations = oldBlock.Statements.Where(s => s is LocalDeclarationStatementSyntax l && l.UsingKeyword != default); 844var newUsingDeclarations = newBlock.Statements.Where(s => s is LocalDeclarationStatementSyntax l && l.UsingKeyword != default);
EditAndContinue\SyntaxUtilities.cs (2)
161var firstGetter = accessorList?.Accessors.Where(a => a.IsKind(SyntaxKind.GetAccessorDeclaration)).FirstOrDefault(); 241=> body.DescendantNodesAndSelf(LambdaUtilities.IsNotLambda).Where(SyntaxBindingUtilities.BindsToResumableStateMachineState);
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
76.WithModifiers([PrivateKeyword, .. fieldSyntax.Modifiers.Where(m => !modifierKinds.Contains(m.Kind()))]) 131.Where(n => n.Span.IntersectsWith(span));
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
53=> jumpOutOfRegionStatements.Where(n => n is ReturnStatementSyntax).Any();
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
428.Where(n => n.Kind() is SyntaxKind.DeclarationExpression or SyntaxKind.DeclarationPattern);
ExtractMethod\CSharpSelectionValidator.cs (2)
446=> jumpsOutOfRegion.Where(n => n is not ReturnStatementSyntax).Any(); 450var returnStatements = jumpsOutOfRegion.Where(s => s is ReturnStatementSyntax);
GenerateType\CSharpGenerateTypeService.cs (1)
762if (compilationRoot.Usings.Where(n => n != null && n.Alias == null)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
386var localFunctions = innermostCommonBlock.DescendantNodes().Where(node => node.IsKind(SyntaxKind.LocalFunctionStatement) && matches.Any(match => match.Span.OverlapsWith(node.Span)));
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (2)
69methodGroup = methodGroup.Where(m => (m.IsStatic && includeStatic) || (!m.IsStatic && includeInstance)); 75methodGroup = methodGroup.Where(m => m.IsStatic || m is IMethodSymbol { MethodKind: MethodKind.LocalFunction });
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
72accessorList: SyntaxFactory.AccessorList([.. (IEnumerable<AccessorDeclarationSyntax>)accessors.Where(a => a is not null)]));
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
83var nonGlobalUsings = compilationUnit.Usings.Where(u => u.GlobalKeyword == default);
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
236.Where(t => t.Kind() != SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
72.Where(m => IsTwoArgumentSliceLikeMethod(m))
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (3)
29.Where(p => IsPublicInstance(p) && 130.Where(p => p.IsIndexer && 147.Where(m => IsPublicInstance(m) &&
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\ConvertToRecord\ConvertToRecordEngine.cs (1)
108.Where(field => !field.IsConst && !field.IsStatic)
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (1)
42var docCommentNodes = leadingTrivia.Where(f => f.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia));
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
161var expressionTriviaWithoutEndOfLine = expressionTrivia.Where(t => !t.IsKind(SyntaxKind.EndOfLineTrivia));
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
195.Where(u => u.GlobalKeyword == default) 199var compilationUnitWithoutUsings = compilationUnit.WithUsings([.. compilationUnit.Usings.Where(u => u.GlobalKeyword != default)]);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
79var badStatements = descendentStatements.Where(s => EmbeddedStatementPlacementDiagnosticAnalyzer.StatementNeedsWrapping(s));
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
120.Where(a => a.Initializer?.ElementValues.FirstOrDefault()?.Syntax.SpanStart == diagnostic.Location.SourceSpan.Start)
StringIndentation\CSharpStringIndentationService.cs (1)
99var errors = interpolatedString.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (3)
Diagnostics\Suppression\SuppressionTests.cs (1)
1106foreach (var trivia in context.Node.DescendantTrivia().Where(t => t.Kind() is SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia))
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (1)
95foreach (var kind in Enum.GetValues(typeof(SyntaxKind)).Cast<SyntaxKind>().Where(hasLabel))
EditAndContinue\SyntaxUtilitiesTests.cs (1)
24foreach (var oldNode in oldRoot.DescendantNodes().Where(n => n.FullSpan.Length > 0))
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_ICompoundAssignmentOperation.cs (1)
87var outSymbol = implicitSymbols.Where(sym => sym != inSymbol).Single();
IOperation\IOperationTests_ISymbolInitializer.cs (1)
33var nodes = tree.GetRoot().DescendantNodes().Where(n => n is VariableDeclarationSyntax || n is PropertyDeclarationSyntax).ToArray();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ObjectFormatterTests.cs (1)
504obj = Enumerable.Range(0, 10).Where(i =>
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (328)
Semantics\AccessCheckTests.cs (2)
743IAliasSymbol aliasA = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().Where(u => u.Alias != null).Single()) as IAliasSymbol; 897IAliasSymbol SomeAlias = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().Where(u => u.Alias != null).Single());
Semantics\BindingAwaitTests.cs (1)
1899var calls = actualIL.Split(new[] { '\n', '\r' }, System.StringSplitOptions.RemoveEmptyEntries).Where(s => s.Contains("OnCompleted")).ToArray();
Semantics\BindingTests.cs (20)
2365var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.ThisExpression)).Cast<ThisExpressionSyntax>().Single(); 2384var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.ThisExpression)).Cast<ThisExpressionSyntax>().Single(); 2782.Where(x => x.Identifier.ValueText.Equals("MyMethod")).ToArray(); 2888var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single(); 2889var param = node.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 2925var lambda = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single(); 2927var param = lambda.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 2967var lambda = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single(); 2969var param = lambda.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 3037var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent; 3051var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent; 3117var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent; 3131var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent; 3190var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent; 3205var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent; 3275var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent; 3290var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent; 3380var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "MathMin").Single().Parent; 3732var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "E").Single().Parent; 3912var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "G").First();
Semantics\ColorColorTests.cs (4)
1892var node2 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.Text == "E" && (n.Parent is EqualsValueClauseSyntax)).Single(); 1949var node2 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.Text == "E" && (n.Parent is EqualsValueClauseSyntax)).Single(); 2006var node2 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.Text == "E" && (n.Parent is EqualsValueClauseSyntax)).Single(); 2055var node2 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.Text == "E" && (n.Parent is EqualsValueClauseSyntax)).Single();
Semantics\ConstantTests.cs (1)
1455Where(predicate).
Semantics\DeconstructionTests.cs (7)
4176Assert.Same(x1, model.GetSymbolInfo(refs.Where(r => r.Identifier.ValueText == "x1").Single()).Symbol); 4181Assert.Same(x2, model.GetSymbolInfo(refs.Where(r => r.Identifier.ValueText == "x2").Single()).Symbol); 5986var mainCall = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single(); 6029var mainCall = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single(); 6069var mainCall = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single(); 6111var two = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "2").Single(); 6151var mainCall = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single();
Semantics\DelegateTypeTests.cs (4)
10386var variables = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(v => v.Initializer != null); 11086var variables = nodes.OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.Text == "d").ToArray(); 11092var identifiers = nodes.OfType<InvocationExpressionSyntax>().Where(i => i.Expression is IdentifierNameSyntax id && id.Identifier.Text == "Report").Select(i => i.ArgumentList.Arguments[0].Expression).ToArray(); 11170var variables = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.Text == "d").ToArray();
Semantics\DynamicTests.cs (110)
3860var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single(); 3893var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single(); 3921var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single(); 3949var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single(); 4000var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single(); 4976var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5059node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5100var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5182node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5223var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5306node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5341var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5382var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5426var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5470var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5514var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5578var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 5616var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 5655var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "e").Single(); 5691var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5732var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5777var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5822var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5867var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 5935var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 5974var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 6022var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6104node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6145var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6227node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6265var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6347node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6377var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6419var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6466var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6510var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 6552var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 6606var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 6671var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 6736node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 6780var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 6845node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 6890var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 6956node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 6991var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7059var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7118node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7162var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7230node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7275var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7346node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7391var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7463node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7504var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7581var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7642node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7686var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7748node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7792var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7854node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7895var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 7967var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8029node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8073var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8135node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8178var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8239node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8283var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8348node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8392var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8457node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8501var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8566node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8611var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8677node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8724var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8793var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 8861var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 10009var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10014node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10092node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10137var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10142node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10220node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10265var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10270node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10348node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10419var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10424node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10500node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10553var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10558node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10647node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10701var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10706node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10797node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 10971var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10976node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 11063node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single(); 11100var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 11184var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 11262var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 11317var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 11370var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 11450var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 11494var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 11535var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 11584var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 11636var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single(); 11680var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
Semantics\ForEachTests.cs (1)
3421var node = tree.GetRoot().DescendantNodes().Where(n => n.Kind() == SyntaxKind.ForEachStatement).OfType<ForEachStatementSyntax>().Single();
Semantics\ImplicitObjectCreationTests.cs (1)
4574var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "aParameter").Single();
Semantics\InterpolationTests.cs (1)
4602.Where(b => b.DescendantNodes().OfType<InterpolatedStringExpressionSyntax>().Any())
Semantics\IteratorTests.cs (2)
458var yieldNode = (YieldStatementSyntax)tree.GetRoot().DescendantNodes().Where(n => n is YieldStatementSyntax).SingleOrDefault(); 481var yieldNode = (YieldStatementSyntax)tree.GetRoot().DescendantNodes().Where(n => n is YieldStatementSyntax).SingleOrDefault();
Semantics\LambdaDiscardParametersTests.cs (7)
68var underscores = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.Identifier.ToString() == "_").ToArray(); 417var underscoreParameters = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.ToString() == "_").ToArray(); 422var underscore = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(p => p.ToString() == "_").Single(); 448var underscores = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(p => p.ToString() == "_").ToArray(); 482var underscore = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(p => p.ToString() == "_").Single(); 513var underscores = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(p => p.ToString() == "_").ToArray(); 566var underscoreParameters = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.ToString() == "_").ToArray();
Semantics\LambdaTests.cs (19)
842Where(e => e.Kind() == SyntaxKind.AddExpression).Single(); 1037.Where(e => e.ToFullString() == "x/* */") 1091.Where(e => e.ToFullString() == "o/* */") 1513var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 1548var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 1582var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 1614var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single(); 1979var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.AnonymousMethodExpression)).Single(); 2997ExpressionSyntax contentType = tree.GetCompilationUnitRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ContentType").Single(); 3004ExpressionSyntax b = tree.GetCompilationUnitRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "b").Single(); 3039ExpressionSyntax contentType = tree.GetCompilationUnitRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ContentType").Single(); 3046ExpressionSyntax b = tree.GetCompilationUnitRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "b").Single(); 6510.Where(i => i.Identifier.ValueText == "parameter") 6511.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.Attribute) || a.IsKind(SyntaxKind.DefaultExpression) || a.IsKind(SyntaxKind.InvocationExpression))) 6820.Where(i => i.Identifier.ValueText == "_") 6821.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.InvocationExpression))) 6849.Where(i => i.Identifier.ValueText == "_") 6850.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.InvocationExpression))) 8011.Where(n => n.IsKind(SyntaxKind.ParenthesizedLambdaExpression))
Semantics\LocalFunctionTests.cs (23)
1720var x = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.ValueText == "x").Single(); 1769.Where(id => id.Identifier.ValueText == "A") 1787.Where(id => id.Identifier.ValueText == "CLSCompliant") 1844.Where(id => id.Identifier.ValueText == "A") 1862.Where(id => id.Identifier.ValueText == "CLSCompliant") 4690var designation = descendents.OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == name).Single(); 4694var refs = descendents.OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == name).ToArray(); 4731var declarator = descendents.OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == name).Single(); 4735var refs = descendents.OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == name).ToArray(); 4962var b2 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "b2").Single(); 4965var b1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "b1").Single(); 6552Where(n => n.Expression.ToString() == "nameof"). 7383return node.DescendantNodes().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "TParameter").Single(); 7451return tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == identifier).Single().SpanStart; 7640.Where(i => i.Identifier.ValueText == "TParameter") 7641.Where(i => i.Ancestors().Any(a => a.Kind() is SyntaxKind.Attribute or SyntaxKind.TypeConstraint or SyntaxKind.DefaultExpression or SyntaxKind.InvocationExpression or SyntaxKind.EqualsValueClause)) 8685.Where(i => i.Identifier.ValueText == parameterName) 8686.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.Attribute) || a.IsKind(SyntaxKind.TypeConstraint) || a.IsKind(SyntaxKind.DefaultExpression) || a.IsKind(SyntaxKind.InvocationExpression))) 8964return node.DescendantNodes().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "parameter").Single(); 9553.Where(i => i.Identifier.ValueText == "value") 9554.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.Attribute))) 10173.Where(i => i.Identifier.ValueText == "P") 10174.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.Attribute)))
Semantics\LookupPositionTests.cs (1)
3177string[] curr = prev.Where(x => !removed.Contains(x)).ToArray();
Semantics\LookupTests.cs (7)
1394var systemNS = (INamespaceSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("System") && sym.Kind == SymbolKind.Namespace).Single(); 1501var node = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "m.M").Single(); 1524var namespaceX = (INamespaceSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("X") && sym.Kind == SymbolKind.Namespace).Single(); 1533var typeA = (INamedTypeSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("A") && sym.Kind == SymbolKind.NamedType).Single(); 1538var aliasY = (IAliasSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("aliasY") && sym.Kind == SymbolKind.Alias).Single(); 1643var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "returne<double>").First(); 1670var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "System.Object").First();
Semantics\NameOfTests.cs (13)
685var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "SomeClass.Goo").OfType<ExpressionSyntax>().First(); 711var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "SomeClass.Goo").OfType<ExpressionSyntax>().First(); 746var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First(); 793var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First(); 830var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First(); 866var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Nested").OfType<ExpressionSyntax>().First(); 912var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "A.Extension").OfType<ExpressionSyntax>().First(); 945var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First(); 1018.Where(e => e.Expression is IdentifierNameSyntax { Identifier.ValueText: "nameof" }) 1092.Where(e => e.Expression is IdentifierNameSyntax { Identifier.ValueText: "nameof" }) 1175.Where(e => e.Expression is IdentifierNameSyntax { Identifier.ValueText: "nameof" }) 1256.Where(e => e.Expression is IdentifierNameSyntax { Identifier.ValueText: "nameof" }) 1422var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "X1.Extension").OfType<ExpressionSyntax>().First();
Semantics\NullableReferenceTypesTests.cs (4)
3693var lambda = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single(); 3695var param = lambda.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 35000var varDecl = tree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().Where(d => d.Declaration.Type.IsVar).Single(); 155997var identifiers = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "global::Program").ToArray();
Semantics\NullCoalesceAssignmentTests.cs (1)
184var defaultLiteral = syntaxRoot.DescendantNodes().OfType<LiteralExpressionSyntax>().Where(expr => expr.IsKind(SyntaxKind.DefaultLiteralExpression)).Single();
Semantics\ObjectAndCollectionInitializerTests.cs (2)
4096var nodes = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(n => n.ToString() == "2"); 4168var nodes = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(n => n.ToString() == "2");
Semantics\OperatorTests.cs (10)
3213.Where(x => x.Contains("//-")) 7490Where(node => (object)node != null).ToArray(); 7706Where(node => (object)node != null).ToArray(); 7875Where(node => (object)node != null).ToArray(); 8035Where(node => (object)node != null).ToArray(); 8556Where(node => (object)node != null).ToArray(); 8589var nodes = tree.GetRoot().DescendantNodes().Where(node => node is BinaryExpressionSyntax || node is AssignmentExpressionSyntax).ToArray(); 8635Where(node => (object)node != null).ToArray(); 8685Where(node => node is not null).ToArray(); 8759Where(node => (object)node != null).ToArray();
Semantics\OverloadResolutionTestBase.cs (1)
49.Where(x => x.Contains("//-"))
Semantics\QueryTests.cs (20)
1453var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 1662var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 1722var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 1760var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 2384var selectClause = tree.GetCompilationUnitRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SelectClause)).Single() as SelectClauseSyntax; 2385var fromClause1 = tree.GetCompilationUnitRoot().DescendantNodes().Where(n => (n.IsKind(SyntaxKind.FromClause)) && (n.ToString().Contains("num1"))).Single() as FromClauseSyntax; 2386var fromClause2 = tree.GetCompilationUnitRoot().DescendantNodes().Where(n => (n.IsKind(SyntaxKind.FromClause)) && (n.ToString().Contains("num2"))).Single() as FromClauseSyntax; 2484var selectClause = tree.GetCompilationUnitRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SelectClause)).Single() as SelectClauseSyntax; 2548var selectClause = tree.GetCompilationUnitRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SelectClause)).Single() as SelectClauseSyntax; 2583var orderingClause = tree.GetCompilationUnitRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.AscendingOrdering)).Single() as OrderingSyntax; 2716var queryExpr = tree.GetCompilationUnitRoot().DescendantNodes().OfType<QueryExpressionSyntax>().Where(x => x.ToFullString() == "from i in expr1 let ").Single(); 2897var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "C").Single(); 2930var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "C").Single(); 3378.Where(e => e.ToString() == "assem2") 3387.Where(e => e.ToString() == "assem1") 3420var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 3464var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 3511var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Test").Single(); 3550var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Test2").Single(); 3598var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "QueryExpressionTest").Single();
Semantics\RawInterpolationTests_Handler.cs (1)
2903.Where(b => b.DescendantNodes().OfType<InterpolatedStringExpressionSyntax>().Any())
Semantics\RecordStructTests.cs (4)
2594var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2629var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2663var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2698var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
Semantics\RefFieldTests.cs (8)
12381Where(d => d.Type is ScopedTypeSyntax && d.Designation is SingleVariableDesignationSyntax). 12568Where(d => d.Type is ScopedTypeSyntax && d.Designation is SingleVariableDesignationSyntax). 17946var decls = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.Text == "f").ToArray(); 22831var decls = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.Text is "r1" or "r2").ToArray(); 22899var decls = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.Text is "r1" or "r2").ToArray(); 26788foreach (var node in tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText is "a" or "b" or "c")) 26840foreach (var node in tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText is "a" or "b" or "c")) 26892foreach (var node in tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText is "a" or "b" or "c"))
Semantics\ScriptSemanticsTests.cs (4)
404var members = global.GetMembers().Where(m => !m.IsImplicitlyDeclared).AsImmutable(); 1313var x = syntaxTree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 1342x = syntaxTree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 1357x = syntaxTree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
Semantics\TargetTypedDefaultTests.cs (3)
1736var defaults = nodes.OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default"); 1802var defaults = nodes.OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default"); 1873var defaults = nodes.OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default");
Semantics\TopLevelStatementsTests.cs (41)
492var localFuncRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local").Single(); 500var localRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").Single(); 540var localRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").ToArray(); 584var localFuncRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local").Single(); 591var localRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").Single(); 699var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "s").Single(); 873Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single()).Symbol); 879Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single()).Symbol); 987Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").First()).Symbol); 991Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Skip(1).Single()).Symbol); 1042Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single()).Symbol); 1407var nameRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 1425nameRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 1520var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "c").Single(); 1706var nameRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray(); 1882var nameRefs = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray(); 2100var nameRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray(); 2266var nameRefs = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray(); 2446var nameRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray(); 2919var nameRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias1" && !id.Parent.IsKind(SyntaxKind.NameEquals)).Single(); 2924nameRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias2").Single(); 2941nameRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias2" && !id.Parent.IsKind(SyntaxKind.NameEquals)).Single(); 2946nameRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias1").Single(); 3941var nameRefs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").ToArray(); 4090var nameRefs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").ToArray(); 4216var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local").Single(); 4512Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Single()).Symbol); 4518Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Single()).Symbol); 4576Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").First()).Symbol); 4580Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Skip(1).Single()).Symbol); 4625Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single()).Symbol); 4894var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single(); 4952Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single()).Symbol); 4959Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single()).Symbol); 4979var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single(); 6034var localRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").ToArray(); 6277var localRef = syntaxTree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 6317var localRef = syntaxTree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 6368var localRef = syntaxTree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 8673var id = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ar").Single(); 8695var id = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ar").Single();
Semantics\TypeOfTests.cs (1)
33var node = (ObjectCreationExpressionSyntax)tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "new C(0)").Last();
Semantics\UnsafeTests.cs (3)
8345foreach (var nullSyntax in tree.GetCompilationUnitRoot().DescendantTokens().Where(token => token.IsKind(SyntaxKind.NullKeyword))) 8381foreach (var declarationSyntax in tree.GetCompilationUnitRoot().DescendantNodes().OfType<VariableDeclarationSyntax>().Where(syntax => syntax.GetFirstToken().IsKind(SyntaxKind.VoidKeyword))) 10224var dereferences = tree.GetCompilationUnitRoot().DescendantNodes().Where(syntax => syntax.IsKind(SyntaxKind.PointerIndirectionExpression)).ToArray();
Semantics\Utf8StringsLiteralsTests.cs (1)
4081foreach (var node in tree.GetCompilationUnitRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(b => b.IsKind(SyntaxKind.AddExpression)))
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (93)
Compilation\SemanticModelAPITests.cs (8)
111.Where(e => e.Name.ToString() == "GenericExtension").First(); 404var nsArray = tree.GetCompilationUnitRoot().DescendantNodes().Where(node => node.IsKind(SyntaxKind.NamespaceDeclaration)).ToArray(); 425var nsArray = tree.GetCompilationUnitRoot().DescendantNodes().Where(node => node.IsKind(SyntaxKind.FileScopedNamespaceDeclaration)).ToArray(); 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); 4611var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(ident => ident.Identifier.Text == "global").Single(); 4625var nodes = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(ident => ident.Identifier.Text == "global").ToArray();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (3)
3866var node = (IdentifierNameSyntax)tree.GetCompilationUnitRoot().DescendantTokens().Where(t => t.ToString() == "Alias").Last().Parent; 3901var param = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.Identifier.ValueText == "name").First(); 4604var node = (DefaultExpressionSyntax)tree.GetCompilationUnitRoot().DescendantNodes().Where(i => i is DefaultExpressionSyntax).First();
Compilation\SemanticModelGetSemanticInfoTests.cs (3)
14791Where(node => (object)node != null).ToArray(); 14887Where(node => (object)node != null).ToArray(); 14998Where(node => (object)node != null).ToArray();
Compilation\UsedAssembliesTests.cs (5)
107var comp2 = comp.RemoveAllReferences().AddReferences(used.Concat(comp.References.Where(r => r.Properties.Kind == MetadataImageKind.Module))); 115var tryRemove = specificReferencesToAssert.Where(reference => reference.Properties.Kind == MetadataImageKind.Assembly && !used.Contains(reference)); 283AssertEx.Equal(comp.References.Where(r => r.Properties.Kind == MetadataImageKind.Assembly), comp.GetUsedAssemblyReferences()); 333var tryRemove = specificReferencesToAssert.Where(reference => reference.Properties.Kind == MetadataImageKind.Assembly && !used.Contains(reference)); 344var comp2 = comp.RemoveAllReferences().AddReferences(used.Concat(comp.References.Where(r => r.Properties.Kind == MetadataImageKind.Module)));
SymbolDisplay\SymbolDisplayTests.cs (7)
6610.Where(n => n.Kind() == SyntaxKind.LocalFunctionStatement) 6653.Where(n => n.Kind() == SyntaxKind.LocalFunctionStatement) 6687.Where(n => n.Kind() == SyntaxKind.LocalFunctionStatement) 6782.Where(n => n.Kind() == SyntaxKind.LocalFunctionStatement) 7039var declarations = semanticModel.SyntaxTree.GetRoot().DescendantNodes().Where(n => n.Kind() == SyntaxKind.StructDeclaration).Cast<BaseTypeDeclarationSyntax>().ToArray(); 7077var declarations = semanticModel.SyntaxTree.GetRoot().DescendantNodes().Where(n => n.Kind() == SyntaxKind.StructDeclaration).Cast<BaseTypeDeclarationSyntax>().ToArray(); 7115var declarations = semanticModel.SyntaxTree.GetRoot().DescendantNodes().Where(n => n.Kind() == SyntaxKind.StructDeclaration).Cast<BaseTypeDeclarationSyntax>().ToArray();
Symbols\CheckedUserDefinedOperatorsTests.cs (10)
7210var xNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 7211var yNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single(); 7282var xNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 7283var yNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single(); 7353var xNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 7354var yNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single(); 7426var xNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 7427var yNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single(); 7490var xNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single(); 7491var yNode = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single();
Symbols\ExtensionMethodTests.cs (4)
3866var instance = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First(); 3913var instance = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First(); 3958var instance = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First(); 4008var instance = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First();
Symbols\GenericConstraintTests.cs (2)
7393var nest = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "Nest").Single(); 7418var nest = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "Nest").Single();
Symbols\ImplicitClassTests.cs (1)
74var toStringIdentifier = identifiers.Where(node => node.Identifier.ValueText.Equals("ToString")).Single();
Symbols\IndexerTests.cs (1)
2539node.DescendantNodesAndSelf().Where(s => s.IsKind(SyntaxKind.ElementAccessExpression)).Cast<ElementAccessExpressionSyntax>();
Symbols\Metadata\MetadataTypeTests.cs (2)
372var id = newTree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(s => s.ToString() == "StaticModClass").First(); 387id = newTree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(s => s.ToString() == "StaticModClass").First();
Symbols\Metadata\PE\TypeForwarders.cs (3)
1091var actualNamespaces = EnumerateNamespaces(compilation).Where(ns => 1155var actualNamespaces = EnumerateNamespaces(compilation).Where(ns => 1219var actualNamespaces = EnumerateNamespaces(compilation).Where(ns =>
Symbols\Source\BaseClassTests.cs (1)
2031var baseY = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "y").OfType<ExpressionSyntax>().First();
Symbols\Source\EventTests.cs (1)
43var actual = string.Join(", ", actualSymbols.Where(s => !s.IsImplicitlyDeclared).Select(symbol => symbol.Name).OrderBy(name => name));
Symbols\Source\MethodTests.cs (4)
236var node = tree.GetRoot().DescendantNodes().OfType<PredefinedTypeSyntax>().Where(n => n.Keyword.Kind() == SyntaxKind.VoidKeyword).First(); 264var node = tree.GetRoot().DescendantNodes().OfType<PredefinedTypeSyntax>().Where(n => n.Keyword.Kind() == SyntaxKind.VoidKeyword).Last(); 289var node = tree.DescendantNodes().OfType<PredefinedTypeSyntax>().Where(n => n.Keyword.Kind() == SyntaxKind.VoidKeyword).Single(); 310var node = tree.DescendantNodes().OfType<PredefinedTypeSyntax>().Where(n => n.Keyword.Kind() == SyntaxKind.VoidKeyword).Single();
Symbols\Source\NullablePublicAPITests.cs (11)
288return c.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).ToArray(); 480var members = c.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).ToArray(); 488members = e.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).Select(m => m.ReduceExtensionMethod(m.Parameters[0].Type)).ToArray(); 693comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 757comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 822comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 889comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("IB")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 2629var sRef = root.DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "s").Single(); 2663var select = root.DescendantNodes().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "Select").Single(); 2701var select = root.DescendantNodes().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "Select").Single(); 4730var suppressions = tree.GetRoot().DescendantNodes().OfType<PostfixUnaryExpressionSyntax>().Where(p => p.IsKind(SyntaxKind.SuppressNullableWarningExpression)).ToList();
Symbols\Source\UsingAliasTests.cs (2)
697var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Short").Skip(1).Single(); 740var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Short").Skip(1).Single();
Symbols\StaticAbstractMembersInInterfacesTests.cs (11)
10752var node = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + " 1").Single(); 10945var node = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + " 1").Single(); 11135var node = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + " y").Single(); 11329var node1 = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + op + " y").First(); 11583var node1 = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + op + " y").First(); 11960var node = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(n => n.ToString() == "x " + op + "= 1").Single(); 19560var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First(); 19643var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First(); 19735var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First(); 19824var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First(); 28773var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
Symbols\SymbolExtensionTests.cs (1)
252var method = model.GetSymbolInfo(tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Method").Single()).Symbol.GetSymbol<MethodSymbol>();
Symbols\UnsignedRightShiftTests.cs (13)
123var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 124var shift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftExpression).First(); 626var unsignedShift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First(); 627var shift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftAssignmentExpression).First(); 1176var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 1177var shift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftExpression).First(); 1584var unsignedShift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First(); 1585var shift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftAssignmentExpression).First(); 1983var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 2235var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 2377var unsignedShift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First(); 2511var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 2608var unsignedShift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (27)
Parsing\LanguageVersionTests.cs (1)
21Where(x => x != LanguageVersion.Latest && x != LanguageVersion.Preview && x != LanguageVersion.LatestMajor).
Parsing\LocalFunctionParsingTests.cs (1)
1229.Where(n => n.Kind() == SyntaxKind.MethodDeclaration)
Syntax\LambdaUtilitiesTests.cs (1)
57var methodDef = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(d => d.Identifier.ValueText == "M").Single();
Syntax\SyntaxNodeTests.cs (22)
519var nodesWithMyAnnotations = exprWithAnnotations.DescendantNodesAndSelf(n => n.ContainsAnnotations).Where(n => n.HasAnnotation(myAnnotation)).ToList(); 1033var tokens = tree.GetCompilationUnitRoot().DescendantTokens(descendIntoTrivia: true).Where(SyntaxToken.NonZeroWidth).ToList(); 1133var tokens = tree.GetCompilationUnitRoot().DescendantTokens(descendIntoTrivia: true).Where(SyntaxToken.NonZeroWidth).ToList(); 2264var tokens = expr.DescendantTokens().Where(t => t.IsKind(SyntaxKind.IdentifierToken)).ToList(); 2382var deepTrivia = expr.GetDirectives().SelectMany(d => d.DescendantTrivia().Where(tr => tr.Kind() == SyntaxKind.WhitespaceTrivia)).ToList(); 2406var trivia = expr.DescendantTrivia().Where(tr => tr.IsKind(SyntaxKind.WhitespaceTrivia)).ToList(); 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(); 3443Where(token => token.Kind() != SyntaxKind.EndOfFileToken).
Syntax\SyntaxRewriterTests.cs (2)
337var tokenT = tree.GetCompilationUnitRoot().DescendantTokens().Where(t => t.ToString() == "T").Single(); 349var typeName = tree.GetCompilationUnitRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.GenericName)).Single();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
CSharpTestBase.cs (3)
774return tree.GetRoot().DescendantNodes().OfType<T>().Where(e => e.ToString() == text); 1363var resolvedReferences = comp.References.Where(r => r.Properties.Kind == MetadataImageKind.Assembly); 1374var comp2 = comp.RemoveAllReferences().AddReferences(used.Concat(comp.References.Where(r => r.Properties.Kind == MetadataImageKind.Module)));
SemanticModelTestBase.cs (1)
110var constructorInitializers = node.DescendantNodesAndSelf(n => !(n is ExpressionSyntax)).Where(isConstructorInitializer);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinRTCollectionTests.cs (1)
7424var add = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Add").Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (27)
CodeGeneration\CSharpSyntaxGenerator.cs (4)
824var abstractVirtualModifiers = operatorDeclaration.Modifiers.Where(x => 1006Flatten(declaration.GetAttributeLists().Where(al => !IsReturnAttribute(al)))); 1019Flatten(declaration.GetAttributeLists().Where(al => IsReturnAttribute(al)))); 3668.Where(trivia => !trivia.Any(t => t.IsRegularOrDocComment()))
Formatting\CSharpSyntaxFormattingService.cs (1)
119return tokenEdits.Where(t => t.Span.Start >= token.FullSpan.Start).ToImmutableArray();
Rename\LocalConflictVisitor.cs (2)
166foreach (var child in body.ChildNodes().Where(c => c.Kind() != SyntaxKind.QueryContinuation)) 186var statements = node.ChildNodes().Where(x => x.IsKind(SyntaxKind.SwitchSection)).SelectMany(x => x.ChildNodes());
Simplification\CSharpSimplificationService.Expander.cs (1)
770var typeArgumentListSyntax = simpleName.DescendantNodesAndSelf().Where(n => n is TypeArgumentListSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (3)
38block.CloseBraceToken.LeadingTrivia.Where(t => !t.IsWhitespaceOrEndOfLine())); 53var leadingDirectives = statement.GetLeadingTrivia().Where(IsAnyCodeDirective).ToImmutableArray(); 54var closeBraceLeadingDirectives = block.CloseBraceToken.LeadingTrivia.Where(IsAnyCodeDirective).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaListExtensions.cs (3)
21.Where(t => t.Kind() == SyntaxKind.EndOfLineTrivia) 28.Where(t => t.IsRegularComment()) 38.Where(t => t is (kind: SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia or SyntaxKind.WhitespaceTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
255var originalIdentifierNodes = originalLambdaBody.DescendantNodes().OfType<IdentifierNameSyntax>().Where(node => paramNames.Contains(node.Identifier.ValueText)); 261var replacedIdentifierNodes = replacedLambdaBody.DescendantNodes().OfType<IdentifierNameSyntax>().Where(node => paramNames.Contains(node.Identifier.ValueText));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
301.Where(n => n is IdentifierNameSyntax id && id.Identifier.ValueText.Equals(identifier.ValueText))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
195=> declaration.ChildTokens().Where(t => t.Kind() is SyntaxKind.OpenBraceToken or SyntaxKind.CloseBraceToken && t.IsMissing).Any();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
456newAttributeLists = attributeLists.Where(aList => aList != attributeList); 462var newAttributes = SeparatedList(attributes.Where(a => a != attributeToRemove));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
29.Where(f => f.Modifiers.Any(SyntaxKind.ConstKeyword)) 40.Where(f => f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)) 44.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.ConstKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
554.Where(p => p.IsIndexer && p.Parameters.Length > index); 764.Where(p => p.Name == name) 1329foreach (var sibling in initializerExpression.Expressions.Where(e => e.Kind() != SyntaxKind.ComplexElementInitializerExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (1)
48.Where(o => IsSymbolReferencedByOperation(o, symbol));
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
Formatting\FormattingTriviaTests.cs (2)
1745tree = tree.ReplaceTrivia(tree.DescendantTrivia().Where(tr => tr.IsKind(SyntaxKind.EndOfLineTrivia)), (o, r) => SyntaxFactory.ElasticMarker); 1787.Where(tr => tr.IsKind(SyntaxKind.EndOfDirectiveToken)), (o, r) => o.WithTrailingTrivia(o.LeadingTrivia.Add(SyntaxFactory.ElasticEndOfLine(newLine)))
Microsoft.CodeAnalysis.EditorFeatures (8)
Editor\TextBufferAssociatedViewService.cs (1)
49foreach (var buffer in subjectBuffers.Where(b => IsSupportedContentType(b.ContentType)))
ExtractMethod\ExtractMethodCommandHandler.cs (1)
99var spans = view.Selection.GetSnapshotSpansOnBuffer(textBuffer).Where(s => s.Length > 0).ToList();
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (3)
247var trackingSpansTouched = GetEditableSpansForSnapshot(args.After).Where(ss => ss.IntersectsWith(boundingIntersectionSpan)); 356.Select(document => (document, conflictResolution.GetReplacements(document.Id).Where(r => GetRenameSpanKind(r.Kind) != RenameSpanKind.None).ToImmutableArray())) 439var relevantReplacements = conflictResolution.GetReplacements(document.Id).Where(r => GetRenameSpanKind(r.Kind) != RenameSpanKind.None);
Interactive\SendToInteractiveSubmissionProvider.cs (1)
39: args.TextView.Selection.GetSnapshotSpansOnBuffer(args.SubjectBuffer).Where(ss => ss.Length > 0);
Options\EditorAnalyzerConfigOptions.cs (1)
46=> _configOptions.Keys.Where(IsLowercase);
Shared\Extensions\MefExtensions.cs (1)
39return extensions.Where(h => contentTypes.Any(d => d.MatchesAny(h.Metadata.ContentTypes))).ToList();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (6)
CodeLens\AbstractCodeLensTest.cs (4)
23foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 51foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 77foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 103foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any()))
SignatureHelp\AbstractSignatureHelpProviderTests.cs (1)
468var documentId = testWorkspace.Documents.Where(d => d.Name == "SourceDocument").Single().Id;
Workspaces\EditorTestWorkspace.cs (1)
323var namedSpans = markupSpans.Where(kvp => kvp.Key != string.Empty);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
CodeActions\CodeChangeProviderMetadataTests.cs (2)
155.Where(field => field.FieldType == typeof(string)) 182.Where(part => ((string[])part.Export.Metadata["Languages"]!).Contains(language));
CodeGeneration\CodeGenerationTests.cs (1)
911.Where(s => s != null).FirstOrDefault() as T;
SymbolFinder\DependentTypeFinderTests.cs (4)
580var delegates = transitiveImpls.Where(i => i.TypeKind == TypeKind.Delegate); 584Assert.Single(delegates.Where(i => i.Locations.Any(loc => loc.IsInSource))); // We should find a single source delegate 610var enums = transitiveImpls.Where(i => i.TypeKind == TypeKind.Enum); 614Assert.Single(enums.Where(i => i.Locations.Any(loc => loc.IsInSource))); // We should find a single source type
Workspaces\ClassificationTypeNamesTests.cs (1)
25public static IEnumerable<object[]> AllClassificationTypeNames => typeof(ClassificationTypeNames).GetAllFields().Where(
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Interactive\InertClassifierProvider.InertClassifier.cs (1)
34return classifications.Where(c => c.Span.IntersectsWith(span)).ToList();
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
DkmUtilities.cs (1)
43Where(module =>
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (4)
Debugger\Engine\DkmClrRuntimeInstance.cs (1)
50this.Modules = assemblies.Select(a => getModule(this, a)).Where(m => m != null).ToArray();
Debugger\Engine\DkmClrType.cs (2)
209var members = type.GetMembers(MemberBindingFlags).Where(TypeHelpers.IsVisibleMember); 283var attributesData = type.GetCustomAttributesData().Where(data => data.AttributeType == typeof(DebuggerVisualizerAttribute));
Debugger\MemberInfo\TypeImpl.cs (1)
307return infos.Where(i => i != null).ToArray();
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
LanguageServices\FSharpVisualStudioWorkspaceExtensions.cs (1)
24var projects = workspace.CurrentSolution.Projects.Where(p => string.Equals(p.OutputFilePath, filePath, StringComparison.OrdinalIgnoreCase)).ToList();
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (2)
RazorPredefinedProviderNameTests.cs (2)
52.Where(field => field.FieldType == typeof(string)) 59.Where(property => property.PropertyType == typeof(string))
Microsoft.CodeAnalysis.Features (47)
AddImport\AbstractAddImportFeatureService.cs (1)
450var viableProjects = new HashSet<Project>(solution.Projects.Where(p => p.SupportsCompilation));
AddImport\SymbolReferenceFinder.cs (2)
142.Where(NotNull) 143.Where(NotGlobalNamespace)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
191diagnostics = diagnostics.Where(IsFixableDiagnostic);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
126var filteredTriviaList = triviaList.Where(shouldIncludeTrivia);
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
135var orderedTextInserts = allTextChanges.Where(change => change.Span.IsEmpty)
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (1)
38.Where(lazyLanguageService => IsEmbeddedLanguageProvider(lazyLanguageService, languageName, embeddedLanguageServiceType))
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (2)
56members = members.Where(m => IsInitializable(m, enclosing) && 63var uninitializedMembers = members.Where(m => !alreadyTypedMembers.Contains(m.Name));
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
82nonGlobalAliasedProjectReferencesSet.AddRange(currentProject.ProjectReferences.Where(pr => !HasGlobalAlias(pr.Aliases)).Select(pr => pr.ProjectId));
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
273model.Compilation.GetTypeByMetadataName).Where(t => !IsNullOrErrorType(t));
Debugging\AbstractBreakpointResolver.cs (3)
113return members.Where(m => IsApplicable(m, parameterCount, cancellationToken)). 143types = types.Where(t => MatchesName(t, nameParts[0], _identifierComparer)); 204var types = containers.SelectMany(GetTypeMembersRecursive).Where(t => MatchesNames(t, names, _identifierComparer));
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
69var typeNames = member.DescendantNodes().Where(n => IsQualifiedOrSimpleName(n) && !n.Span.IsEmpty);
EditAndContinue\EditSession.cs (1)
752.Where(edit => edit is { PartialType: not null, Kind: SemanticEditKind.Update })
EditAndContinue\EmitSolutionUpdateResults.cs (1)
261.Where(static e => e.Diagnostics.HasBlockingRudeEdits())
EmbeddedLanguages\EmbeddedLanguageCommentOptions.cs (1)
25.Where(f => f.FieldType == typeof(TOptions))
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingWorkItem.cs (1)
47=> SpecificAnalyzers?.Count > 0 ? SpecificAnalyzers.Where(allAnalyzers.Contains) : allAnalyzers;
ExtractMethod\MethodExtractor.Analyzer.cs (2)
795foreach (var pair in symbolMap.Where(p => p.Key.Kind == SymbolKind.TypeParameter)) 919foreach (var pair in symbolMap.Where(p => p.Key.Kind == SymbolKind.Field))
FindUsages\AbstractFindUsagesService_FindImplementations.cs (1)
144var overrides = result.Where(s => s.IsOverride).ToImmutableArray();
FullyQualify\AbstractFullyQualifyService.cs (2)
177.Where(n => !n.IsGlobalNamespace && HasAccessibleTypes(n, semanticModel, cancellationToken)) 313.Where(n => n.Symbol is INamedTypeSymbol or INamespaceSymbol { IsGlobalNamespace: false })
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
284.Where(reference => !reference.IsImplicit)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
723.Where(s => !s.Equals(symbolGroup.First().OriginalDefinition))
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
205.Where(s => IsAccessible(s, enclosingType))
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
102.Where(m => setMethodName.Equals(m.Name, StringComparison.OrdinalIgnoreCase))
SignatureHelp\AbstractSignatureHelpProvider.cs (1)
101var filteredList = items.Where(i => Include(i, parameterNames)).ToList();
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
638=> nodes.Where(n => n.FirstAncestorOrSelf<TConstructorDeclaration>() is null);
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (3)
128.Where(w => GetXmlElementLocalName(w) == nodeName) 137.Where(w => GetXmlElementLocalName(w) == nodeName) 147.Where(nameAttributes => nameAttributes.Count == 1)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (4)
28.Where(f => !f.IsImplicitlyDeclared) 29.Where(f => includeMemberType(f.Type)) 34.Where(p => !p.IsImplicitlyDeclared && p.Parameters.Length == 0 && p.GetMethod != null) 35.Where(p => includeMemberType(p.Type))
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
79.Where(group => group.Key is not null)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
834.Where(n => n.HasAnnotation(s_newLocalDeclarationStatementAnnotation) ||
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
50var upgradeableProjects = solution.Projects.Where(p => CanUpgrade(p, language, newVersion)).AsImmutable();
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
23var codeBlocks = executableCodeBlocks?.Where(c => c != null).AsImmutableOrEmpty() ?? ImmutableArray<SyntaxNode>.Empty;
StackTraceExplorer\StackFrameMethodSymbolResolver.cs (1)
27.Where(m => m.Name == methodName)
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
172.Where(diagnostic => diagnostic.Location.SourceTree?.FilePath == document.FilePath)
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (2)
48.Where(framework => framework.Dependencies != null) 49.SelectMany(framework => framework.Dependencies!.Keys.Where(key => framework.Dependencies[key].AutoReferenced))
UnusedReferences\UnusedReferencesRemover.cs (1)
31.Where(project => projectFilePath.Equals(project.FilePath, StringComparison.OrdinalIgnoreCase));
ValueTracking\ValueTracker.OperationCollector.cs (1)
47var returnOperations = operation.Descendants().Where(d => d is IReturnOperation && (allowImplicit || !d.IsImplicit));
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
509=> ToMatchingPairs(match.Matches.Where(partners => partners.Key != match.OldRoot));
RelatedDocuments\AbstractRelatedDocumentsTests.cs (1)
48var expectedSortedResults = workspace.Documents.Where(d => d.SelectedSpans.Count > 0).Select(d => d.Id).OrderBy(d => d.Id);
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
637pathParts = pathParts.Where(s => s != ThisDirectory).ToArray();
Microsoft.CodeAnalysis.LanguageServer (2)
BrokeredServices\Services\BrokeredServiceBridgeManifest\BrokeredServiceBridgeManifestService.cs (1)
46.Where(s => s.Name.StartsWith("Microsoft.CodeAnalysis.LanguageServer.", StringComparison.Ordinal) ||
Program.cs (1)
110.Where(f => f.Name.StartsWith("Microsoft.CodeAnalysis.", StringComparison.Ordinal) && !f.Name.Contains("LanguageServer", StringComparison.Ordinal))
Microsoft.CodeAnalysis.LanguageServer.Protocol (23)
Extensions\Extensions.cs (1)
167var projects = solution.Projects.Where(project => project.FilePath == projectIdentifier.Uri.LocalPath).ToImmutableArray();
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (1)
79=> GetStateSets(project.Id).Where(s => s.Language == project.Language);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (1)
142var stateSetMap = StateSetMap.Where(kvp => !excludedAnalyzers.Contains(kvp.Key)).ToImmutableDictionary();
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (2)
59_activeFileStates.Where(kv => !kv.Value.IsEmpty) 61.Concat(_projectStates.Where(kv => !kv.Value.IsEmpty())
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (3)
293var nonSuppressionActions = actions.Where(a => !IsTopLevelSuppressionAction(a.OriginalCodeAction)).ToImmutableArray(); 296var suppressionActions = actions.Where(a => IsTopLevelSuppressionAction(a.OriginalCodeAction) && 300bulkConfigurationActions.AddRange(actions.Where(a => IsBulkConfigurationAction(a.OriginalCodeAction)));
Handler\Diagnostics\DiagnosticSourceProviders\DiagnosticSourceManager.cs (4)
40.Where(p => p.IsDocument) 44.Where(p => !p.IsDocument) 49=> _nameToDocumentProviderMap.Where(kvp => kvp.Value.IsEnabled(clientCapabilities)).SelectAsArray(kvp => kvp.Key); 52=> _nameToWorkspaceProviderMap.Where(kvp => kvp.Value.IsEnabled(clientCapabilities)).SelectAsArray(kvp => kvp.Key);
Handler\Diagnostics\WorkspacePullDiagnosticHandler.cs (1)
59=> diagnosticsParams.PreviousResults?.Where(d => d.PreviousResultId != null).Select(d => new PreviousPullResult(d.PreviousResultId!, d.TextDocument!)).ToImmutableArray();
Handler\InlineCompletions\XmlSnippetParser.CodeSnippet.cs (2)
81return codeSnippetsElement.Elements().Where(e => e.Name.LocalName.Equals("CodeSnippet", StringComparison.OrdinalIgnoreCase)).ToImmutableArray(); 93return element.Elements().Where(e => e.Name.LocalName.Equals(localName, StringComparison.OrdinalIgnoreCase));
Handler\SemanticTokens\SemanticTokensSchema.cs (1)
101.Where(tokenType => !SemanticTokenTypes.AllTypes.Contains(tokenType))
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 (4)
92this.objectUnionTypeInfos = objectUnionTypeInfosSet.Where(t => t.KindAttribute is not null).Concat( 93objectUnionTypeInfosSet.Where(t => t.KindAttribute is null)).ToList(); 131.Where(mi => 142.Where(mi =>
Workspaces\LspWorkspaceManager.cs (2)
396_trackedDocuments.Keys.Where(static uri => uri.Scheme == SourceGeneratedDocumentUri.Scheme) 398.Where(tuple => tuple.identity.HasValue)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (11)
Ordering\RequestOrderingTests.cs (6)
126Assert.Empty(responses.Where(r => r == null)); 127Assert.Empty(responses.Where(r => r!.StartTime == default)); 149Assert.Empty(responses.Where(r => r == null)); 150Assert.Empty(responses.Where(r => r!.StartTime == default)); 290Assert.Empty(responses.Where(r => r == null)); 291Assert.Empty(responses.Where(r => r!.StartTime == default));
SemanticTokens\AbstractSemanticTokensTests.cs (1)
103var kind = tokenTypeToIndex.Where(kvp => kvp.Value == tokens[i + 3]).Single().Key;
Workspaces\LspWorkspaceManagerTests.cs (4)
670var oldClassDeclarations = originalRoot.DescendantNodes().Where(n => syntaxFacts.IsClassDeclaration(n)).ToImmutableArray(); 671var newClassDeclarations = newRoot.DescendantNodes().Where(n => syntaxFacts.IsClassDeclaration(n)).ToImmutableArray(); 680var oldMethodDeclarations = originalRoot.DescendantNodes().Where(n => syntaxFacts.IsMethodLevelMember(n)).ToImmutableArray(); 681var newMethodDeclarations = newRoot.DescendantNodes().Where(n => syntaxFacts.IsMethodLevelMember(n)).ToImmutableArray();
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
86.Where(pair => pair.text.CanBeEmbedded)
Microsoft.CodeAnalysis.Rebuild.UnitTests (3)
DeterministicKeyBuilderTests.cs (3)
58.Where(x => ignoreSections.Contains(x.Name)) 111.Where(x => x.Name == lastName && getFullName(x) == sectionName) 136value.Properties().Where(x => x.Name == ignoreProperty).Single().Remove();
Microsoft.CodeAnalysis.Remote.ServiceHub (4)
Host\TestUtils.cs (4)
55var mismatch1 = assetMapFromNewSolution.Where(p => !allChecksumsFromRequest.Contains(p.Key)).ToList(); 59var mismatch2 = assetMapFromIncrementalSolution.Where(p => !allChecksumsFromRequest.Contains(p.Key)).ToList(); 63var mismatch3 = assetMapFromNewSolution.Where(p => !assetMapFromIncrementalSolution.ContainsKey(p.Key)).ToList(); 66var mismatch4 = assetMapFromIncrementalSolution.Where(p => !assetMapFromNewSolution.ContainsKey(p.Key)).ToList();
Microsoft.CodeAnalysis.Scripting (2)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (2)
336members.AddRange(type.DeclaredFields.Where(f => !f.IsStatic)); 337members.AddRange(type.DeclaredProperties.Where(f => f.GetMethod != null && !f.GetMethod.IsStatic));
Microsoft.CodeAnalysis.Scripting.TestUtilities (1)
CSharpScriptTestBase.cs (1)
49args?.Where(a => a != null).ToArray() ?? s_defaultArgs,
Microsoft.CodeAnalysis.Test.Utilities (31)
Assert\AssertEx.cs (3)
530ToString(actual.Where(i => !predicate(i))))); 728=> expected.Where(c => !char.IsWhiteSpace(c)).SequenceEqual(actual.Where(c => !char.IsWhiteSpace(c)));
Compilation\CompilationTestDataExtensions.cs (1)
62var keys = map.Keys.Where(k => k.StartsWith(qualifiedMethodName + "(", StringComparison.Ordinal));
Compilation\ControlFlowGraphVerifier.cs (1)
522IFlowCaptureReferenceOperation[] referencesAfter = getFlowCaptureReferenceOperationsInRegion(region, block.Ordinal + 1).Where(r => r.Id.Equals(id)).ToArray();
Compilation\IRuntimeEnvironment.cs (1)
253.Where(t => t.text.CanBeEmbedded && !string.IsNullOrEmpty(t.filePath))
CompilationVerifier.cs (1)
81images.AddRange(_allModuleData.Where(m => m.Kind == OutputKind.NetModule).Select(m => m.Image));
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
2105foreach (var member in members.Where(m => !m.IsImplicitlyDeclared))
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (1)
206.Where(t =>
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 (8)
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)); 139expectedArguments = expectedArguments.Where(a => !symbolKindsWithNoCodeBlocks.Contains(a.SymbolKind)); 142expectedArguments = expectedArguments.Where(a => IsOnCodeBlockSupported(a.SymbolKind, a.MethodKind, a.ReturnsVoid)); 144var actualOnCodeBlockStartedArguments = _callLog.Where(a => FilterByAbstractName(a, "CodeBlockStart")) 146var actualOnCodeBlockEndedArguments = _callLog.Where(a => FilterByAbstractName(a, "CodeBlock")) 174.Where(p => p.IsMissing).Select(p => p.Element).ToList();
Metadata\ILValidation.cs (1)
341.Descendants().Where(e => e.Name == "files").Single()
Platform\Desktop\DesktopRuntimeEnvironment.cs (1)
126.Where(x => missingList.Contains(x.Id))
Platform\Desktop\RuntimeAssemblyManager.cs (1)
68internal IEnumerable<ModuleData> ModuleDatas => _fullNameToAssemblyDataMap.Values.Where(x => x.Kind == Kind.ModuleData).Select(x => x.ModuleData);
Platform\Desktop\TestHelpers.cs (1)
32return assembly.GetTypes().Where((t) =>
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)
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(); 88return node.DescendantTokens().Where(t => !SkipCSharpToken(t)).ToList(); 92return node.DescendantTokens().Where(t => !SkipVisualBasicToken(t)).ToList();
TestHelpers.cs (1)
36return assembly.GetTypes().Where(t =>
Microsoft.CodeAnalysis.UnitTests (14)
AnalyzerAssemblyLoaderTests.cs (2)
496.Where(x => isInLoadFromContext(loader, x)); 1461Assert.Single(AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName == assembly.FullName));
Analyzers\AnalyzerFileReferenceTests.cs (1)
156var failedTypes = errors.Where(e => e.ErrorCode == AnalyzerLoadFailureEventArgs.FailureErrorCode.UnableToCreateAnalyzer).Select(e => e.TypeName);
Collections\DebuggerAttributes.cs (4)
83.Where(fi => fi.IsPublic && GetDebuggerBrowsableState(fi) != DebuggerBrowsableState.Never); 91.Where(pi => pi.GetGetMethod() != null && GetDebuggerBrowsableState(pi) != DebuggerBrowsableState.Never); 106.Where(a => a.AttributeType == typeof(DebuggerTypeProxyAttribute)) 134.Where(a => a.AttributeType == typeof(DebuggerDisplayAttribute))
Collections\ImmutableSetTest.cs (1)
339results.AddRange(GetIsProperSubsetOfScenarios().Where(s => s.Item3));
Collections\List\CollectionAsserts.cs (4)
85Assert.Equal(e.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count()), a.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count())); 104Assert.Equal(e.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count()), a.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count()));
MetadataReferences\MetadataHelpersTests.cs (1)
451Assert.False(nestedNamespaces.GroupBy(pair => pair.Key).Where(g => g.Count() > 1).Any());
PEWriter\InstructionOperandTypesTests.cs (1)
27foreach (FieldInfo fi in typeof(OpCodes).GetFields(BindingFlags.Public | BindingFlags.Static).Where(f => !reserved.Contains(f.Name)))
Microsoft.CodeAnalysis.VisualBasic (1)
Syntax\SyntaxNodeRemover.vb (1)
307.Where(Function(tr) tr.IsDirective) _
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
FlowAnalysis\FlowDiagnosticTests.vb (1)
915Assert.NotEmpty(Me.FlowDiagnostics(comp).AsEnumerable().Where(Function(e) e.Severity = DiagnosticSeverity.[Warning]))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
Parser\VisualBasicParseOptionsTests.vb (1)
86Where(Function(x) x <> LanguageVersion.Latest).
Microsoft.CodeAnalysis.Workspaces (94)
CodeCleanup\AbstractCodeCleanerService.cs (2)
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());
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (2)
93var filtered = documentToDiagnostics.Where(kvp => 118.Where(d => d.Location.IsInSource)
CodeFixes\FixAllOccurrences\FixAllContext.cs (1)
251return diagnostics.Where(d => d != null && diagnosticIds.Contains(d.Id)
CodeFixes\FixAllOccurrences\FixAllContext.DiagnosticProvider.cs (1)
48return result.Where(kvp => !kvp.Value.IsDefaultOrEmpty).ToImmutableDictionary();
CodeFixes\FixAllOccurrences\FixAllContextHelper.cs (1)
68.Where(p => p.Language == project.Language)
CodeFixesAndRefactorings\DefaultFixAllProviderHelpers.cs (1)
85.Where(p => p.Language == fixAllContext.Project.Language);
Diagnostics\HostDiagnosticAnalyzers.cs (1)
157=> CreateAnalyzerReferencesMap(projectAnalyzerReferences.Where(reference => !_hostAnalyzerReferencesMap.ContainsKey(reference.Id)));
Editing\SymbolEditor.cs (1)
197.Where(d => d != null);
FindSymbols\FindReferences\DependentTypeFinder_Remote.cs (1)
31var projectIds = projects?.Where(p => RemoteSupportedLanguages.IsSupported(p.Language)).SelectAsArray(p => p.Id) ?? default;
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (1)
28.Where(f => symbol.Equals(f.AssociatedSymbol))
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));
Options\SolutionOptionSet.cs (2)
81var internallyDefined = _changedOptionKeys.Where(key => key.Option is IOption2).SelectAsArray(key => KeyValuePairUtil.Create(new OptionKey2((IOption2)key.Option, key.Language), _values[key])); 82var externallyDefined = _changedOptionKeys.Where(key => key.Option is not IOption2).SelectAsArray(key => KeyValuePairUtil.Create(key, _values[key]));
ReassignedVariable\AbstractReassignedVariableService.cs (1)
273.Where(s => s.SyntaxTree == semanticModel.SyntaxTree)
Recommendations\AbstractRecommendationServiceRunner.cs (2)
302var aliases = semanticModel.LookupSymbols(_context.Position, container).OfType<IAliasSymbol>().Where(a => systemNamespace.Equals(a.Target)); 327var aliases = _context.SemanticModel.LookupSymbols(_context.Position, container).OfType<IAliasSymbol>().Where(a => specialTypeSymbol.Equals(a.Target));
Rename\ConflictEngine\ConflictResolver.cs (4)
253.Where(s => !s.MatchesKind(SymbolKind.Method, SymbolKind.Property) || 259.Where(s => s.Kind != SymbolKind.Method || renamedSymbol.Kind != SymbolKind.Method); 268.Where(s => !s.Equals(renamedSymbol) && 281var conflictingSymbolLocations = otherThingsNamedTheSame.Where(s => !s.IsKind(SymbolKind.Namespace));
Rename\ConflictEngine\ConflictResolver.Session.cs (4)
364.Where(t => t.DocumentId == documentId) 442foreach (var unprocessedDocumentIdWithPotentialDeclarationConflicts in allDocumentIdsInProject.Where(d => !documentIdsForConflictResolution.Contains(d))) 543var newLocations = (await Task.WhenAll(newLocationTasks).ConfigureAwait(false)).WhereNotNull().Where(loc => loc.IsInSource); 810.Where(t => t.DocumentId == documentId)
Rename\ConflictEngine\DeclarationConflictHelpers.cs (2)
20.Where(m => !m.Equals(renamedMethod) && m.Arity == renamedMethod.Arity); 31.Where(m => !m.Equals(renamedProperty) && m.Parameters.Length == renamedProperty.Parameters.Length);
Rename\ConflictEngine\RenamedSpansTracker.cs (1)
57? modifiedSpans.Where(pair => pair.oldSpan.Start < startingPosition)
Rename\Renamer.RenameSymbolDocumentAction.cs (1)
74var typeDeclarations = syntaxRoot.DescendantNodesAndSelf(n => !syntaxFacts.IsMethodBody(n)).Where(syntaxFacts.IsTypeDeclaration);
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
371.Where(t => syntaxFactsService.IsStringLiteralOrInterpolatedStringLiteral(t) && t.Span.Length >= renameTextLength) 389.Where(t => t.Span.Length >= renameTextLength)
Shared\Extensions\IFindReferencesResultExtensions.cs (1)
106let aliasLocations = r.Locations.Where(loc => SymbolEquivalenceComparer.Instance.Equals(loc.Alias, aliasSymbol)).ToImmutableArray()
Shared\Extensions\ILanguageMetadataExtensions.cs (2)
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);
Shared\Extensions\ILanguageServiceProviderExtensions.cs (1)
23return items.Where(lazy => lazy.Metadata.Language == serviceProvider.Language);
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (3)
130tasks = waiters.Select(x => x.ExpeditedWaitAsync()).Where(t => !t.IsCompleted).ToList(); 198=> _singletonListeners.Values.Where(l => l.TrackActiveTokens).SelectMany(l => l.ActiveDiagnosticTokens).ToList(); 244return _singletonListeners.Where(kv => featureNames.Contains(kv.Key)).Select(kv => (IAsynchronousOperationWaiter)kv.Value);
Shared\Utilities\ExtensionOrderer.Graph.cs (1)
22return this.Nodes.Keys.Where(k => k.Metadata.Name == name);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
637pathParts = pathParts.Where(s => s != ThisDirectory).ToArray();
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
348return source.Where((Func<T?, bool>)s_notNullTest)!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
45.Where(tuple => tuple.matchKind.IsBetterOrEqualMatchThan(matchKind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (1)
32=> cfg.DescendantOperations().Where(d => d?.Kind == operationKind).Cast<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (2)
371.Where(t => t.IsAbstractClass()) 597var matches = result.Where(kvp =>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
29: symbol.GetMembers(WellKnownMemberNames.Indexer).OfType<IPropertySymbol>().Where(p => p.IsIndexer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (4)
550return ((INamedTypeSymbol)symbol).GetMembers().OfType<IPropertySymbol>().Where(p => p.CanBeReferencedByName); 654var getAwaiters = potentialGetAwaiters.OfType<IMethodSymbol>().Where(x => !x.Parameters.Any()); 706.Where(x => x.DeclaredAccessibility == Accessibility.Public) 746.Where(x => x.DeclaredAccessibility == Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (3)
440return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within))); 505return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within))); 515return types.SelectMany(x => x.GetMembers(memberName).OfType<T>().Where(m => m.IsAccessibleWithin(within)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
99.Where(s => !s.IsAnonymousTypeProperty() && !s.IsTupleField());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
35? token.Parent.AncestorsAndSelf().Where(predicate)
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\AbstractSyntaxFormatting.cs (1)
42spansToFormat = new NormalizedTextSpanCollection(spans.Where(s_notEmpty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
111=> TokenStream.GetTriviaDataWithTokenPair(cancellationToken).Where(d => d.Item2.ContainsChanges);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
403.Where(e => e.Name.LocalName == "SymbolKind" && e.Value == "Method").ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (1)
69.Where(m => m.Parent is TTypeDeclarationSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
55var exteriorTrivia = leadingTrivia.Where(_syntaxFacts.IsDocumentationCommentExteriorTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
340.Where(t => !syntaxFacts.IsElastic(t)) 345.Where(t => !syntaxFacts.IsElastic(t))
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\BKTree.Builder.cs (1)
97var distinctValues = values.Where(v => v.Length > 0).Distinct(CaseInsensitiveComparison.Comparer).ToArray();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
24.Where(f => f.HasConstantValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
286var filteredMembers = membersList.Where(m => !m.IsImplicitlyDeclared || m.IsTupleField());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
174var leadingTrivia = node.GetLeadingTrivia().Where(trivia => !trivia.IsDirective);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
358var nonHiddenExtractedSelectedNodes = ExtractNodesSimple(selectionNode, syntaxFacts).OfType<TSyntaxNode>().Where(n => !n.OverlapsHiddenPosition(cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (3)
56var nodes = root.DescendantNodesAndSelf(OverlapsWithSpan).Where(OverlapsWithSpan); 185var annotatedNodes = syntaxNodes.Where(x => x.HasAnnotations(SymbolAnnotation.Kind)); 242var importsToAdd = importToSyntax.Where(kvp => safeImportsToAdd.Contains(kvp.Key)).Select(kvp => kvp.Value).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
166var nodesToVerify = nodesBySemanticBoundary.Where(group => group.Skip(1).Any()).Flatten().ToSet();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
507.Where(field => !field.IsStatic)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (4)
143var filteredImports = newImports.Where(i => !HasExistingImport(i, containers, globalImports)).ToArray(); 146var usingDirectives = filteredImports.OfType<TUsingOrAliasSyntax>().Where(IsSimpleUsing).ToArray(); 147var staticUsingDirectives = filteredImports.OfType<TUsingOrAliasSyntax>().Where(IsStaticUsing).ToArray(); 148var aliasDirectives = filteredImports.OfType<TUsingOrAliasSyntax>().Where(IsAlias).ToArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (2)
40firstToken.LeadingTrivia.Where(t => IsDocCommentOrElastic(syntaxFacts, t))); 46firstToken.LeadingTrivia.Where(t => !IsDocCommentOrElastic(syntaxFacts, t)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
81var filteredCandidates = filter != null ? candidates.Where(filter) : candidates;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
78return types.Where(filterUnusable ? IsUsableTypeFunc : s_isNotNull)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
304importDeclarations.Where(n => !isNodeOrTokenOutsideSimplifySpan(n) && n.HasAnnotation(Simplifier.Annotation)),
Workspace\Host\PersistentStorage\IPersistentStorageConfiguration.cs (1)
96val = new string(val.Where(c => !s_invalidPathChars.Contains(c)).ToArray());
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
327var entry = _documentPathsToDocumentIds.Where(kv => kv.Value == documentId).FirstOrDefault();
Workspace\Solution\ProjectDependencyGraph.cs (1)
152.Where(r => ProjectIds.Contains(r.ProjectId))
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
26.Where(r => ProjectIds.Contains(r.ProjectId))
Workspace\Solution\SolutionState.cs (1)
440var newProjectIds = ProjectIds.Where(p => !projectIdsSet.Contains(p)).ToBoxedImmutableArray();
Workspace\Workspace_Editor.cs (1)
282return _bufferToAssociatedDocumentsMap.Where(kvp => kvp.Value.Contains(documentId)).Select(kvp => kvp.Key).FirstOrDefault();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
MSBuild\ProjectFile\ProjectFile.cs (2)
165.Where(IsNotTemporaryGeneratedFile) 462var items = references.Where(it => it.EvaluatedInclude.StartsWith(partialName, StringComparison.OrdinalIgnoreCase)).ToList();
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
637pathParts = pathParts.Where(s => s != ThisDirectory).ToArray();
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
348return source.Where((Func<T?, bool>)s_notNullTest)!;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
MSBuildWorkspaceTestBase.cs (1)
29AssertEx.Equal(expectedFailures, workspace.Diagnostics.Where(d => d.Kind == WorkspaceDiagnosticKind.Failure).Select(d => d.Message));
NetCoreTests.cs (1)
348var projects = workspace.CurrentSolution.Projects.Where(p => p.FilePath.EndsWith("Project.csproj"));
NewlyCreatedProjectsFromDotNetNew.cs (1)
238.Where(id => !reportedDiagnosticIds.Contains(id));
VisualStudioMSBuildWorkspaceTests.cs (3)
103Assert.Single(projectInfo.Documents.Where(d => d.Name == "CSharpClass.cs")); 843var documents = project.Documents.Where(d => d.Name == "CSharpClass.cs").ToList(); 3244var analyzerConfigDocument = Assert.Single(project.AnalyzerConfigDocuments.Where(d => d.FilePath == expectedEditorConfigPath));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (7)
MEF\ExportProviderCache.cs (1)
99var parts = catalog.Parts.Where(composablePartDefinition => !IsExcludedPart(composablePartDefinition));
WorkspaceExtensions.cs (1)
55=> solution.Projects.Where(p => string.Compare(p.Name, name, StringComparison.OrdinalIgnoreCase) == 0);
Workspaces\TestHostDocument.cs (1)
121foreach (var namedSpanList in spans.Where(s => s.Key != string.Empty))
Workspaces\TestHostProject`1.cs (4)
212=> this.Documents = this.Documents.Where(d => d != document); 221=> this.AdditionalDocuments = this.AdditionalDocuments.Where(d => d != document); 230=> this.AnalyzerConfigDocuments = this.AnalyzerConfigDocuments.Where(d => d != document); 265documents: Documents.Where(d => !d.IsSourceGenerated).Select(d => d.ToDocumentInfo()),
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
CodeStyle\NamingStylePreferencesUpgradeTests.cs (1)
198.Where(group => group.Count() > 1)
FindReferencesTests.cs (1)
134var typeSymbol = result.Where(@ref => @ref.Definition.Kind == SymbolKind.NamedType).Single();
SolutionTests\SolutionTests.cs (1)
5698Assert.Single(frozenCompilation2.References.Where(r => r is CompilationReference c && c.Compilation == frozenCompilation1));
SymbolKeyTests.cs (2)
826var typeParameter = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().Where(n => !n.IsImplicitlyDeclared).Single().TypeParameters.Single(); 840.Where(n => !n.IsImplicitlyDeclared).Single().GetMembers("M").OfType<IMethodSymbol>().Single().TypeParameters.Single();
SyntaxNodeTests.cs (1)
53var nodes = root.DescendantNodes().Where(n => n is VariableDeclaratorSyntax or ClassDeclarationSyntax).ToList();
UtilityTest\IntervalTreeTests.cs (2)
324var set2 = new HashSet<string>(spans.Where(t => 331var set4 = new HashSet<string>(spans.Where(t =>
Microsoft.CodeAnalysis.XunitHook (1)
XunitDisposeHook.cs (1)
21var xunitUtilities = AppDomain.CurrentDomain.GetAssemblies().Where(static assembly => assembly.GetName().Name.StartsWith("xunit.runner.utility")).ToArray();
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (1)
170.Where(member => member.DeclaringType == type && member.Name == name).GetEnumerator();
Microsoft.Data.Analysis.Tests (2)
DataFrameGroupByTests.cs (2)
29var oddGroup = grouping.Where(gr => gr.Key == "odd").FirstOrDefault(); 33var evenGroup = grouping.Where(gr => gr.Key == "even").FirstOrDefault();
Microsoft.DotNet.Arcade.Sdk (3)
src\SourceBuild\AddSourceMappingToNugetConfig.cs (2)
49.Where(e => e.Name == "packageSource") 50.SelectMany(e => e.Descendants().Where(e => e.Name == "package"))
src\SourceBuild\ReadSourceBuildIntermediateNupkgDependencies.cs (1)
119.Where(d => d != null)
Microsoft.DotNet.Arcade.Sdk.Tests (1)
SourceMappingToNugetConfigTest.cs (1)
56.Where(e => e.Attribute("key").Value == "foo")
Microsoft.DotNet.AsmDiff (14)
AssemblySet.cs (2)
40.Where(a => a.Classification == AssemblyClassification.Dependency || 182.Where(a => !(a is Dummy))
DiffCciFilter.cs (2)
122return typeDefinition.Attributes.Where(a => TypeHelper.TypesAreEquivalent(a.Type, generatedAttribute)).Any(); 128return typeDefinitionMember.Attributes.Where(a => TypeHelper.TypesAreEquivalent(a.Type, generatedAttribute)).Any();
DiffCSharpWriter.cs (5)
105var attributes = assembly.Attributes.Where(e => DiffFilter.Include(e.Difference)); 106var properties = assembly.Properties.Where(e => DiffFilter.Include(e.Difference)); 135var attributes = assembly.Attributes.Where(e => DiffFilter.Include(e.Difference)); 136var properties = assembly.Properties.Where(e => DiffFilter.Include(e.Difference)); 233var commentSet = _diffComments.Where((c) => c.DocId == docId).Reverse().ToArray();
DiffEngine.cs (4)
55var diffColumns = DiffCsvColumn.CreateStandardColumns(configuration).Where(c => c.IsVisible).ToArray(); 231foreach (var symbol in diffLine.Tokens.Where(t => t.Kind == DiffTokenKind.Symbol)) 249IEnumerable<DiffToken> relevantTokens = currentLineTokens.Where(t => t.Kind != DiffTokenKind.Indent && 272return tokens.Where(t => t.HasStyle(diffStyle)).Any();
MefHelpers.cs (1)
47var subsetOfConstraints = contract.MetadataConstraints.Where(c => Metadata.ContainsKey(c.Key)).ToDictionary(c => c.Key, c => Metadata[c.Key]);
Microsoft.DotNet.Build.Tasks.Feed (12)
src\common\LatestLinksManager.cs (1)
78.Where(asset => !feedConfig.FilenamesToExclude.Contains(Path.GetFileName(asset)))
src\PublishArtifactsInManifestBase.cs (6)
708FrozenSet<string> excludeFiles = files.Where(x => x is not null or "").ToFrozenSet(); 729string[] symbolPackagesAssetNames = buildAssets?.Keys.Where(x => IsSymbolPackage(x)).Distinct().ToArray() ?? []; 837AssetSelection.NonShippingOnly => packages.Where(p => p.NonShipping).ToHashSet(), 838AssetSelection.ShippingOnly => packages.Where(p => !p.NonShipping).ToHashSet(), 1061AssetSelection.NonShippingOnly => blobs.Where(p => p.NonShipping).ToHashSet(), 1062AssetSelection.ShippingOnly => blobs.Where(p => !p.NonShipping).ToHashSet(),
src\PublishArtifactsInManifestV3.cs (1)
111.Where(ci =>
src\PushToBuildStorage.cs (4)
143Where(i => !string.Equals(i.GetMetadata("ExcludeFromManifest"), "true", StringComparison.OrdinalIgnoreCase)); 164.Where(i => i.ItemSpec.EndsWith("symbols.nupkg")) 174.Where(i => 218.Where(blob => blob != null);
Microsoft.DotNet.Build.Tasks.Feed.Tests (5)
PublishToSymbolServerTest.cs (5)
83IEnumerable<SymbolPublishVisibility> visibilities = Enum.GetValues<SymbolPublishVisibility>().Where(x => x <= maxVisibility); 170Assert.Equal(2, buildEngine.BuildMessageEvents.Where(x => x.Message.Contains("Adding directory")).Count()); 173Assert.Equal(symbolPackages.Keys.Count, buildEngine.BuildMessageEvents.Where(x => x.Message.Contains($"Extracting symbol package")).Count()); 174Assert.Equal(symbolPackages.Keys.Count, buildEngine.BuildMessageEvents.Where(x => x.Message.Contains($"Adding package")).Count()); 180Microsoft.Build.Framework.BuildMessageEventArgs registerLog = buildEngine.BuildMessageEvents.Where(x => x.Message.StartsWith("Would register request")).Single();
Microsoft.DotNet.Build.Tasks.Installers (1)
src\StabilizeWixFileId.cs (1)
72.Where(f => f.Attribute("Source")?.Value
Microsoft.DotNet.Build.Tasks.Packaging (59)
CreateTrimDependencyGroups.cs (4)
83var supportedInboxFrameworks = index.GetAlllInboxFrameworks().Where(fx => IsSupported(fx, resolver)); 95var filteredDependencies = nearestDependencyGroup.Packages.Where(d => !index.IsInbox(d.Id, supportedInboxFramework, d.AssemblyVersion)).ToArray(); 161foreach (var compileAsset in compileAssets.Where(c => !NuGetAssetResolver.IsPlaceholder(c))) 223Packages = new HashSet<TaskItemPackageDependency>(packages.Where(d => d.Id != PlaceHolderDependency));
Extensions.cs (2)
101return metadataValue.Split(';').Where(v => !String.IsNullOrEmpty(v.Trim())).ToArray(); 128.Where(s => s != null);
FilterUnknownPackages.cs (1)
50FilteredDependencies = OriginalDependencies.Where(
FrameworkUtilities.cs (1)
72nearestFrameworks.AddRange(frameworkNames.Where(framework => (GetNearest(framework, frameworks) != null)));
GeneratePackageReport.cs (2)
226var fileFrameworks = _targetPathToPackageItem.Values.Select(f => f.TargetFramework).Distinct(NuGetFramework.Comparer).Where(f => f != null); 346.Where(f => !NuGetAssetResolver.IsPlaceholder(f));
GetApplicableAssetsFromPackageReports.cs (3)
79buildProjects.AddRange(target.CompileAssets.Select(c => c.SourceProject).Where(bp => bp != null)); 81buildProjects.AddRange(target.RuntimeAssets.Select(r => r.SourceProject).Where(bp => bp != null)); 83buildProjects.AddRange(target.NativeAssets.Select(r => r.SourceProject).Where(bp => bp != null));
GetApplicableAssetsFromPackages.cs (4)
101var compileItems = compileAssets.Where(ca => !NuGetAssetResolver.IsPlaceholder(ca)) 104buildProjects.AddRange(compileItems.Select(ci => BuildProjectFromPackageItem(ci)).Where(bp => bp != null)); 125var runtimeItems = runtimeAssets.Where(ra => !NuGetAssetResolver.IsPlaceholder(ra)) 128buildProjects.AddRange(runtimeItems.Select(ri => BuildProjectFromPackageItem(ri)).Where(bp => bp != null));
GetLastStablePackage.cs (1)
150IEnumerable<Version> candidateVersions = (latestVersion == null) ? info.StableVersions : info.StableVersions.Where(sv => VersionUtility.As4PartVersion(sv) < latestVersion);
GetLayoutFiles.cs (1)
119return assets.Where(a => !NuGetAssetResolver.IsPlaceholder(a.LocalPath))
GetMinimumNETStandard.cs (1)
32.Where(fx => fx.Framework == FrameworkConstants.FrameworkIdentifiers.NetStandard)
GetPackageDestination.cs (1)
83var packageTargetFrameworks = PackageTargetFrameworks.NullAsEmpty().Where(p => !String.IsNullOrEmpty(p.ItemSpec));
GetPackageVersion.cs (1)
36var versionsToConsider = Files.Where(f => !String.IsNullOrEmpty(f.GetMetadata("AssemblyVersion")))
GetSupportedPackagesFromPackageReports.cs (1)
31var supportedTargets = report.Targets.Values.Where(target => report.SupportedFrameworks.ContainsKey(target.Framework));
HarvestPackage.cs (6)
172.Where(f => !NuGetAssetResolver.IsPlaceholder(f)); 271.Where(f => IsIncludedExtension(f.GetMetadata("Extension"))) 293var liveDesktopDlls = livePackageFiles.Values.Where(pi => pi.IsDll && pi.TargetFramework?.Framework == FrameworkConstants.FrameworkIdentifiers.Net); 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); 617.Where(f => !ShouldSuppress(f));
NuGetPack.cs (1)
281foreach (var pathPair in pathHasMatches.Where(pathMatchPair => !pathMatchPair.Value))
NuGetUtility.cs (2)
79return provider.LoadPackageSources().Where(e => e.IsEnabled == true).ToList(); 84return versions.Where(v => VersionUtility.As2PartVersion(v) == new Version(eraMajorVersion, eraMinorVersion))
PackageIndex.cs (1)
288inboxFrameworks = info.InboxOn.GetInboxVersions().Where(p => p.Value >= assemblyVersion).Select(p => p.Key);
PromoteDependencies.cs (3)
48var refSets = dependencies.Where(d => d.Id != "_._").Where(d => d.IsReference).GroupBy(d => NuGetFramework.Parse(d.TargetFramework)).ToDictionary(g => g.Key, g => g.ToArray()); 53var libSets = dependencies.Where(d => !d.IsReference).GroupBy(d => NuGetFramework.Parse(d.TargetFramework)).ToDictionary(g => g.Key, g => g.ToArray());
SplitDependenciesBySupport.cs (4)
32List<ITaskItem> splitDependencies = new List<ITaskItem>(dependencies.Where(d => d.TargetFramework != null && d.TargetFramework.Framework != FrameworkConstants.FrameworkIdentifiers.NetStandard).Select(d => d.OriginalItem)); 36var unspecDeps = dependencies.Where(d => d.TargetFramework == null).ToArray(); 44.Where(fx => fx != null && fx.Framework == FrameworkConstants.FrameworkIdentifiers.NetStandard) 52var applicableDependencies = dependencies.Where(d => d.TargetFramework != null &&
UpdatePackageIndex.cs (5)
244var dlls = reader.GetFiles().Where(f => Path.GetExtension(f).Equals(".dll", StringComparison.OrdinalIgnoreCase)); 287var assmVersions = new HashSet<Version>(assemblyVersions.NullAsEmpty().Where(v => v != null)); 307.Where(pair => pair.Value == packageVersion && !assmVersions.Contains(pair.Key)) 314.Where(p => p.Key.StartsWith("runtime.") && p.Key.EndsWith(id)) 316.Where(pair => pair.Value == packageVersion)
ValidateFrameworkPackage.cs (2)
41var testAssetsByName = testAssets.Where(a => Path.GetExtension(a.PackagePath) == ".dll") 71var missingInboxAssemblies = _index.Packages.Where(packageInfo => packageInfo.Value.InboxOn.IsAnyVersionInbox(fx) && !testAssetsByName.ContainsKey(packageInfo.Key));
ValidatePackage.cs (12)
145.Where(fx => fx != null && fx.Framework == _generationIdentifier && fx.Version != null) 150var allSupportedGenerations = _frameworks.Values.Where(vf => vf.SupportedVersion != null && FrameworkUtilities.IsGenerationMoniker(vf.Framework) && vf.Framework.Version != null) 160.Where(f => IsDll(f.LocalPath) && FrameworkUtilities.IsGenerationMoniker(f.TargetFramework))) 267var referenceAssemblies = compileTarget.CompileAssets.Where(ca => IsDll(ca.PackagePath)); 300var implementationAssemblies = runtimeTarget.RuntimeAssets.Where(ra => IsDll(ra.PackagePath)); 342var matchingFxAssets = _report.UnusedAssets.Where(i => i.TargetFramework != null && i.TargetFramework.Equals(fx) && // exact framework 363AllSupportedFrameworks = _frameworks.Values.Where(fx => fx.SupportedVersion != null).Select(fx => fx.ToItem()).OrderBy(i => i.ItemSpec).ToArray(); 388var allAssemblies = allDlls.Where(f => f.Version != null); 413.Where(pair => pair.Value == thisPackageVersion && !assemblyVersions.Contains(pair.Key)) 438var missingModuleNames = moduleNames.Where(m => !index.ModulesToPackages.ContainsKey(m)); 561IEnumerable<ValidationFramework> higherFrameworks = _frameworks.Values.Where(vf => vf.Framework.Framework == fx.Framework && vf.Framework.Version > fx.Version).OrderBy(vf => vf.Framework.Version); 566var uapFrameworks = _frameworks.Values.Where(vf => vf.Framework.Framework == FrameworkConstants.FrameworkIdentifiers.UAP).OrderBy(vf => vf.Framework.Version);
Microsoft.DotNet.Build.Tasks.Packaging.Tests (25)
CreateTrimDependencyGroupsTests.cs (25)
143item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("win8")).Should().HaveCount(1), 144item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("monoandroid10")).Should().HaveCount(1), 145item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("monotouch10")).Should().HaveCount(1), 146item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("net45")).Should().HaveCount(1), 147item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("wp8")).Should().HaveCount(1), 148item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("wpa81")).Should().HaveCount(1), 149item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("xamarinios10")).Should().HaveCount(1), 150item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("xamarintvos10")).Should().HaveCount(1), 151item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("xamarinwatchos10")).Should().HaveCount(1), 152item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("xamarinmac20")).Should().HaveCount(1), 153item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("portable45-net45+win8+wp8+wpa81")).Should().HaveCount(1) 230task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("net45") && 236task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("net451") && 242task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("portable45-net45+win8+wp8+wpa81") && 248task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("portable46-net451+win81+wpa81") && 393item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("win8")).Should().HaveCount(1), 394item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("monoandroid10")).Should().HaveCount(1), 395item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("monotouch10")).Should().HaveCount(1), 396item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("net45")).Should().HaveCount(1), 397item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("wpa81")).Should().HaveCount(1), 398item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("xamarinios10")).Should().HaveCount(1), 399item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("xamarintvos10")).Should().HaveCount(1), 400item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("xamarinwatchos10")).Should().HaveCount(1), 401item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("xamarinmac20")).Should().HaveCount(1), 402item => task.TrimmedDependencies.Where(f => f.GetMetadata("TargetFramework").Equals("portable45-net45+win8+wpa81")).Should().HaveCount(1)
Microsoft.DotNet.Build.Tasks.VisualStudio (2)
OptProf\GenerateTrainingInputFiles.cs (1)
130var filteredIbcEntries = ibcEntries.Where(ibc => ibc.EntryName == filteredTestCase.FileName).ToArray();
Vsix\FinalizeInsertionVsixFile.cs (1)
122var file = ((JArray)json["files"]).Where(f => (string)f["fileName"] == partName).Single();
Microsoft.DotNet.Build.Tasks.Workloads (2)
Msi\WorkloadPackGroupMsi.wix.cs (1)
85var dotnetHomeElement = directoriesDoc.Root.Descendants().Where(d => (string)d.Attribute("Id") == "DOTNETHOME").Single();
Swix\SwixComponent.cs (1)
158ITaskItem? resourceItem = componentResources?.Where(r => string.Equals(r.ItemSpec, workload.Id)).FirstOrDefault();
Microsoft.DotNet.Build.Tasks.Workloads.Tests (4)
CreateVisualStudioWorkloadSetTests.cs (1)
68ITaskItem workloadSetSwixItem = createWorkloadSetTask.SwixProjects.Where(s => s.ItemSpec.Contains(@"Microsoft.NET.Workloads.9.0.100.9.0.100-baseline.1.23464.1\x64")).FirstOrDefault();
CreateVisualStudioWorkloadTests.cs (3)
76ITaskItem manifestMsiItem = createWorkloadTask.Msis.Where(m => m.ItemSpec.ToLowerInvariant().Contains("d96ba8044ad35589f97716ecbf2732fb-x64.msi")).FirstOrDefault(); 143ITaskItem pythonPackSwixItem = createWorkloadTask.SwixProjects.Where(s => s.ItemSpec.Contains(@"Microsoft.Emscripten.Python.6.0.4\x64")).FirstOrDefault(); 212ITaskItem manifestMsiItem = createWorkloadTask.Msis.Where(m => m.ItemSpec.ToLowerInvariant().Contains("d96ba8044ad35589f97716ecbf2732fb-arm64.msi")).FirstOrDefault();
Microsoft.DotNet.GenFacades (6)
GenPartialFacadeSourceGenerator.cs (3)
43.Where(g => g.Count() > 1) 53referenceTypes = referenceTypes.Where(type => !OmitTypes.Contains(type)); 61return defineConstants?.Split(';', ',').Where(t => !string.IsNullOrEmpty(t)).ToArray();
SourceGenerator.cs (1)
56IEnumerable<string> typesToForward = compileFiles == null ? _referenceTypes : _referenceTypes.Where(id => !existingTypes.Contains(id));
TypeParser.cs (2)
60.Where(t => HasPublicModifier(t)); 74.Where(t => HasPublicModifier(t));
Microsoft.DotNet.Helix.Sdk (4)
CreateXHarnessAndroidWorkItems.cs (1)
62WorkItems = Task.WhenAll(tasks).GetAwaiter().GetResult().Where(wi => wi != null).ToArray();
CreateXHarnessAppleWorkItems.cs (1)
84WorkItems = Task.WhenAll(tasks).GetAwaiter().GetResult().Where(wi => wi != null).ToArray();
CreateXUnitWorkItems.cs (1)
80XUnitWorkItems = (await Task.WhenAll(XUnitProjects.Select(PrepareWorkItem))).Where(wi => wi != null).ToArray();
DownloadFromResultsContainer.cs (1)
91var fileAvailableForDownload = allAvailableFiles.Where(f => f.Name == file || f.Name.Replace('\\', '/') == file).FirstOrDefault();
Microsoft.DotNet.MacOsPkg (1)
Package.cs (1)
57List<XElement> componentPackages = xml.Elements("pkg-ref").Where(e => e.Value.Trim() != "").ToList();
Microsoft.DotNet.NuGetRepack.Tests (1)
TestHelpers\AssertEx.cs (1)
304ToString(actual.Where(i => !predicate(i)))));
Microsoft.DotNet.PackageTesting (5)
GetCompatiblePackageTargetFrameworks.cs (3)
35string minDotnetTargetFramework = allTargetFrameworks.Where(t => t.Framework == ".NETCoreApp") 49TestProjects = testProjects.Where(tfm => tfm.ItemSpec != "").ToArray(); 81return frameworksToTest.Where(tfm => allTargetFrameworks.Contains(tfm)).Distinct();
NupkgParser.cs (2)
23.Where(tfm => tfm != null) 25IEnumerable<string> files = nupkgReader.GetFiles()?.Where(t => t.EndsWith(packageId + ".dll"));
Microsoft.DotNet.RemoteExecutor (4)
RemoteExecutor.cs (3)
646.Where(asm => asm != null && asm != currentAssembly) 651.Where(File.Exists) 656.Where(File.Exists)
RemoteInvokeHandle.cs (1)
191foreach (ClrThread thread in runtime.Threads.Where(t => t.IsAlive))
Microsoft.DotNet.SharedFramework.Sdk (5)
src\CreateFrameworkListFile.cs (2)
80.Where(IsTargetPathIncluded) 94.Where(f =>
src\GenerateSharedFrameworkDepsFile.cs (1)
103.Where(expansion => expansion.Contains(RuntimeIdentifier))
src\ValidateFileVersions.cs (2)
75.Where(p => 78.Where(p => (p.Value.FileVersion ?? ZeroVersion) == ZeroVersion)
Microsoft.DotNet.SignCheckLibrary (1)
Verification\Exclusions.cs (1)
122IEnumerable<Exclusion> doNotSignExclusions = _exclusions.Where(e => e.Comment.Contains("DO-NOT-SIGN")).ToArray();
Microsoft.DotNet.SignTool (11)
src\BatchSignUtil.cs (3)
126var filesToSign = files.Where(fileInfo => fileInfo.SignInfo.ShouldSign).ToArray(); 153var enginesToSign = files.Where(fileInfo => fileInfo.SignInfo.ShouldSign && 222var repackList = files.Where(w => toRepackSet.Contains(w.FullPath)).ToList();
src\Configuration.cs (5)
135_wixPacks = _itemsToSign.Where(w => WixPackInfo.IsWixPack(w.ItemSpec))?.Select(s => new WixPackInfo(s.ItemSpec)).ToList(); 339hasSignInfo = signInfos.Where(s => s.CollisionPriorityId == collisionPriorityId).Any(); 340signInfo = signInfos.Where(s => s.CollisionPriorityId == collisionPriorityId).FirstOrDefault(); 367pktBasedSignInfo = pktBasedSignInfos.Where(s => s.CollisionPriorityId == collisionPriorityId).FirstOrDefault(); 470.Where(d => d.ItemSpec == signInfo.Certificate &&
src\SignTool.cs (2)
54var nonOSXFilesToSign = filesToSign.Where(fsi => !SignToolConstants.SignableOSXExtensions.Contains(Path.GetExtension(fsi.FileName))); 55var osxFilesToSign = filesToSign.Where(fsi => SignToolConstants.SignableOSXExtensions.Contains(Path.GetExtension(fsi.FileName)));
src\SignToolTask.cs (1)
310.Where(item => item.GetMetadata("DualSigningAllowed").Equals("true", StringComparison.OrdinalIgnoreCase))
Microsoft.DotNet.SignTool.Tests (1)
SignToolTests.cs (1)
1181var tempFileExtensionSignInfo = s_fileExtensionSignInfo.Where(s => s.Key != ".symbols.nupkg").ToDictionary(e => e.Key, e => e.Value);
Microsoft.DotNet.SourceBuild.Tasks (7)
src\UsageReport\Usage.cs (1)
61.Where(rid => identity.Id.StartsWith($"runtime.{rid}.", StringComparison.Ordinal))
src\UsageReport\ValidateUsageAgainstBaseline.cs (2)
100.Where(u => diff.Added.Contains(u.GetIdentityWithoutRid())) 167.Where(usage =>
src\UsageReport\WritePackageUsageData.cs (2)
90.Where(dir => !dir.StartsWith(RootDir, StringComparison.Ordinal)) 209.Where(id => properties.Contains(id.Id + "/" + id.Version.OriginalVersion)))
src\WriteBuildOutputProps.cs (2)
68.Where(Directory.Exists) 69.Where(dir => Directory.GetDirectories(dir).Count() > 0)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (11)
Modeler\ClassTypeModel.cs (4)
31Properties.Where(p => p.Required && p.ReadOnly) 32.Concat(Properties.Where(p => p.Required && !p.ReadOnly)) 33.Concat(Properties.Where(p => !p.Required && p.ReadOnly)); 35public IEnumerable<PropertyModel> RequiredProperties => Properties.Where(p => p.Required);
Modeler\MethodModel.cs (6)
48Parameters.Where(p => p.Type is TypeReference.ConstantTypeReference).OrderBy(p => p.Name); 51Parameters.Where(p => !(p.Type is TypeReference.ConstantTypeReference)).OrderBy(p => p.Name); 55public IEnumerable<ParameterModel> FormalParametersNoPaging => NonConstantParameters.OrderBy(p => p.Required ? 0 : 1).ThenBy(p => p.Name).Where(p => Paginated == null || (p.Name != Paginated.PageParameterName && p.Name != Paginated.PageSizeParameterName)); 62Parameters.Where(p => p.Location == ParameterLocation.Path); 65Parameters.Where(p => p.Location == ParameterLocation.Query); 68Parameters.Where(p => p.Location == ParameterLocation.Header);
Modeler\ServiceClientModelFactory.cs (1)
179var selectedResponse = operation.Responses.Where(r => r.Key.StartsWith("2")).Select(p => p.Value).FirstOrDefault();
Microsoft.DotNet.VersionTools (15)
Automation\VersionsRepoUpdater.cs (1)
27.Where(path => !NupkgInfo.IsSymbolPackagePath(path))
BuildManifest\BuildManifestClient.cs (1)
163.Where(g => g.Joinable)
BuildManifest\Model\OrchestratedBuildModel.cs (1)
30EndpointModel[] feeds = Endpoints.Where(e => e.IsOrchestratedBlobFeed).ToArray();
BuildManifest\Model\SigningInformationParsingExtensions.cs (4)
55var conflicts = extensionToCertMapping.Where(kv => kv.Value.Count() > 1); 113var conflicts = keyToCertMapping.Where(kv => kv.Value.Count() > 1); 171var conflicts = extensionToCertMapping.Where(kv => kv.Value.Count() > 1); 218var conflicts = pktMapping.Where(kv => kv.Value.Count() > 1);
BuildManifest\Model\XElementParsingExtensions.cs (2)
34.Where(pair => pair.Value != null) 45var missing = requiredAttributes?.Where(r => !attributes.ContainsKey(r)).ToArray();
Dependencies\BuildManifest\OrchestratedBuildIdentityMatch.cs (1)
20.Where(b => b.Name.Equals(buildName, StringComparison.OrdinalIgnoreCase))
Dependencies\BuildOutput\BuildDependencyInfo.cs (1)
42.Where(pair => !disabledPackages.Contains(pair.Key))
Dependencies\BuildOutput\ProjectJsonUpdater.cs (2)
73.Where(buildInfo => buildInfo != null) 152.Where(property => property.Name == "dependencies")
Dependencies\Submodule\LatestCommitSubmoduleUpdater.cs (1)
47.Where(info => info.Repository == Repository)
Dependencies\Submodule\SubmoduleDependencyInfo.cs (1)
26.Where(line => !string.IsNullOrWhiteSpace(line))
Microsoft.DotNet.VersionTools.Tasks (2)
TraceListenerCollectionExtensions.cs (1)
31.Where(type => (type & eventTypeFlags) != 0)
UpdateToRemoteDependencies.cs (1)
85.Where(item => !string.IsNullOrEmpty(item?.GetMetadata(CurrentRefMetadataName))))
Microsoft.DotNet.XliffTasks (3)
Model\XlfDocument.cs (1)
281.Where(tu =>
Tasks\TransformTemplates.cs (2)
77foreach (XElement projectNode in templateXml.Descendants().Where(d => d.Name.LocalName == "Project")) 84foreach (XElement templateItem in templateXml.Descendants().Where(d => d.Name.LocalName == "ProjectItem"))
Microsoft.DotNet.XUnitExtensions (1)
Discoverers\ConditionalTestDiscoverer.cs (1)
55ITypeInfo type = testMethod.TestClass.Class.Assembly.GetTypes(false).Where(t => t.Name.Contains(symbols[0])).FirstOrDefault();
Microsoft.Extensions.DependencyModel (5)
DependencyContextJsonReader.cs (4)
788.Where(e => e.Type == DependencyContextStrings.RuntimeAssetType) 796groupRuntimeAssemblies.Where(a => Path.GetFileName(a.Path) != "_._"))); 800.Where(e => e.Type == DependencyContextStrings.NativeAssetType) 808groupNativeLibraries.Where(a => Path.GetFileName(a.Path) != "_._")));
DependencyContextWriter.cs (1)
308using IEnumerator<RuntimeAssetGroup> groups = assetGroups.Where(g => !string.IsNullOrEmpty(g.Runtime)).GetEnumerator();
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DefaultHealthCheckService.cs (1)
45registrations = registrations.Where(predicate).ToArray();
Microsoft.Extensions.Diagnostics.Probes.Tests (3)
KubernetesProbesExtensionsTests.cs (3)
36var hostedServices = host.Services.GetServices<IHostedService>().Where(service => service.GetType().Name == "TcpEndpointProbesService"); 80var hostedServices = host.Services.GetServices<IHostedService>().Where(service => service.GetType().Name == "TcpEndpointProbesService"); 108var hostedServices = host.Services.GetServices<IHostedService>().Where(service => service.GetType().Name == "TcpEndpointProbesService");
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Windows\Network\WindowsTcpStateInfo.cs (2)
32.Where(ip => IPAddress.TryParse(ip, out var ipAddress) && ipAddress.AddressFamily == AddressFamily.InterNetwork) 38.Where(ip => IPAddress.TryParse(ip, out var ipAddress) && ipAddress.AddressFamily == AddressFamily.InterNetworkV6)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
Linux\Resources\HardcodedValueFileSystem.cs (1)
39.Where(x => x.StartsWith(directory, StringComparison.OrdinalIgnoreCase))
Microsoft.Extensions.Diagnostics.Testing (4)
Metrics\MeasurementExtensions.cs (4)
24=> measurements.Where(m => m.ContainsTags(tags)); 35=> measurements.Where(m => m.ContainsTags(tags)); 46=> measurements.Where(m => m.MatchesTags(tags)); 57=> measurements.Where(m => m.MatchesTags(tags));
Microsoft.Extensions.FileProviders.Embedded (2)
EmbeddedFileProvider.cs (1)
25.Where(c => c != '/' && c != '\\').ToArray();
Manifest\EmbeddedFilesManifest.cs (1)
16.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray();
Microsoft.Extensions.FileProviders.Embedded.Tests (2)
Manifest\TestEntry.cs (2)
34var files = Children.Where(c => c.IsFile).ToArray(); 35var otherFiles = Children.Where(c => !c.IsFile).SelectMany(d => d.GetFiles()).ToArray();
Microsoft.Extensions.FileProviders.Physical (3)
Internal\PathUtils.cs (2)
15.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray(); 18.Where(c => c != '*' && c != '|' && c != '?').ToArray();
PhysicalDirectoryInfo.cs (1)
91.Where(info => !FileSystemInfoHelper.IsExcluded(info, _filters))
Microsoft.Extensions.Http.Diagnostics (1)
Logging\Internal\HttpClientLogger.cs (1)
61_enrichers = enrichers.Where(static x => x is not null).ToArray();
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\AcceptanceTests.cs (1)
621var logRecords = collector.GetSnapshot().Where(l => l.Category == "System.Net.Http.HttpClient.normal.LogicalHandler").ToList();
Logging\HttpClientLoggingTagNamesTest.cs (1)
27.Where(f => f.IsLiteral && f.FieldType == typeof(string))
Microsoft.Extensions.Http.Polly.Tests (1)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (1)
540foreach (var policyType in policyTypes.Where(x => x != missingType))
Microsoft.Extensions.Identity.Stores (1)
UserStoreBase.cs (1)
978var updatedCodes = new List<string>(splitCodes.Where(s => s != code));
Microsoft.Extensions.Localization.Tests (1)
LocalizationServiceCollectionExtensionsTest.cs (1)
48.Where(sd =>
Microsoft.Extensions.Telemetry.Tests (3)
Enrichment\ApplicationEnricherTagTests.cs (1)
28.Where(f => f.IsLiteral && f.FieldType == typeof(string))
Enrichment\ProcessEnricherDimensionsTests.cs (1)
27.Where(f => f.IsLiteral && f.FieldType == typeof(string))
Logging\ExtendedLoggerTests.cs (1)
276var e = a.Where(_ => true);
Microsoft.Gen.ComplianceReports (1)
Parser.cs (1)
39foreach (TypeDeclarationSyntax typeSyntax in typeForSyntaxTree.Where(n => !n.IsKind(SyntaxKind.InterfaceDeclaration)))
Microsoft.Gen.ContextualOptions (14)
ContextReceiver.cs (2)
48.Where(_ => _.symbol is INamedTypeSymbol) 49.Where(_ => _.symbol!.GetAttributes().Any(attribute => SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, holder!.OptionsContextAttribute)))
ContextualOptionsGenerator.cs (2)
40.Where(_ => _.symbol is INamedTypeSymbol) 41.Where(_ => _.symbol!.GetAttributes().Any(attribute => SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, holder!.OptionsContextAttribute)))
Parser.cs (10)
31.Where(modifier => modifier.IsKind(SyntaxKind.StaticKeyword)) 45.Where(modifier => modifier.IsKind(SyntaxKind.RefKeyword)) 79.Where(prop => !prop.IsStatic) 80.Where(prop => !prop.IsWriteOnly) 81.Where(prop => !prop.Type.IsRefLikeType) 82.Where(prop => prop.Type.TypeKind != TypeKind.Pointer) 83.Where(prop => prop.Type.TypeKind != TypeKind.FunctionPointer) 84.Where(prop => prop.Parameters.IsEmpty) 85.Where(prop => prop.ExplicitInterfaceImplementations.IsEmpty) 86.Where(GetterIsPublic)
Microsoft.Gen.Logging (2)
Parsing\Parser.cs (2)
474.Where(x => x is not null && symbols.DataClassificationAttribute is not null && ParserUtilities.IsBaseOrIdentity(x, symbols.DataClassificationAttribute, symbols.Compilation)) 475.Where(x => !SymbolEqualityComparer.Default.Equals(x, symbols.NoDataClassificationAttribute))
Microsoft.Gen.Metrics (1)
Parser.cs (1)
81foreach (var memberSyntax in typeDeclaration.Members.Where(x => x.IsKind(SyntaxKind.MethodDeclaration)))
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
81foreach (var memberSyntax in typeDeclaration.Members.Where(x => x.IsKind(SyntaxKind.MethodDeclaration)))
Microsoft.Interop.ComInterfaceGenerator (9)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
65foreach (var method in type.GetMembers().OfType<IMethodSymbol>().Where(m => !m.IsStatic && m.IsAbstract))
ComInterfaceAndMethodsContext.cs (3)
18public IEnumerable<ComMethodContext> DeclaredMethods => Methods.Where(m => !m.IsInheritedMethod); 23public IEnumerable<ComMethodContext> ShadowingMethods => Methods.Where(m => m.IsInheritedMethod && !m.IsHiddenOnDerivedInterface); 28public IEnumerable<ComMethodContext> InheritedMethods => Methods.Where(m => m.IsInheritedMethod);
ComInterfaceGenerator.cs (4)
369var methodSyntaxTemplate = new ContainingSyntax(new SyntaxTokenList(syntax.Modifiers.Where(static m => !m.IsKind(SyntaxKind.NewKeyword))).StripAccessibilityModifiers(), SyntaxKind.MethodDeclaration, syntax.Identifier, syntax.TypeParameterList); 485.Where(p => p.ManagedToUnmanagedStub is GeneratedStubCodeContext) 511.Where(context => context.Diagnostics.All(diag => diag.Descriptor.DefaultSeverity != DiagnosticSeverity.Error)) 613.Where(context => context.UnmanagedToManagedStub.Diagnostics.All(diag => diag.Descriptor.DefaultSeverity != DiagnosticSeverity.Error))
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
41.Where(p => p.Language == context.Project.Language);
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
41.Where(p => p.Language == context.Project.Language);
Microsoft.Interop.SourceGeneration (7)
DiagnosticOr.cs (2)
131var values = provider.Select((arr, ct) => arr.Where(x => x.HasValue).Select((x, ct) => x.Value).ToSequenceEqualImmutableArray()); 132var diagnostics = provider.SelectMany((arr, ct) => arr.Where(x => x.HasDiagnostic).SelectMany((x, ct) => x.Diagnostics));
MarshallerShape.cs (4)
274.Where(m => m is { IsStatic: true, Parameters.Length: 2, ReturnsVoid: false } 325.Where(m => m is { IsStatic: true, Parameters.Length: 3, ReturnsVoid: false } 576.Where(m => m is { IsStatic: false, Parameters.Length: 2, ReturnsVoid: true } 617.Where(m => m is { IsStatic: false, Parameters.Length: 1, ReturnsVoid: true })
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (1)
414originalTypeSyntax.DescendantNodesAndSelf().OfType<TypeSyntax>().Where(t => t.IsEquivalentTo(marshalInfo.PlaceholderTypeParameter.Syntax)),
Microsoft.ML.AutoML (32)
API\AutoCatalog.cs (6)
753.Where(c => c != null) 821var textFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.TextFeature); 822var numericFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.NumericFeature 825var booleanFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.NumericFeature && !numericFeatures.Contains(c)); 826var catalogFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.CategoricalFeature); 827var imagePathFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.ImagePath);
Experiment\Runners\CrossValRunner.cs (1)
71var newScores = scores.Where(r => !double.IsNaN(r));
Experiment\Runners\CrossValSummaryRunner.cs (2)
173results = results.Where(result => result != null); 185var newResults = results.Where(r => !double.IsNaN(r));
Experiment\SuggestedTrainer.cs (2)
59paramsStr = string.Join(", ", SweepParams.Where(p => p != null && p.RawValue != null).Select(p => $"{p.Name}:{p.ProcessedValue()}")); 66var sweepParams = SweepParams?.Where(p => p.RawValue != null);
PipelineSuggesters\PipelineSuggester.cs (2)
98history = history.Take(availableTrainers.Count()).Where(x => x.RunSucceeded); 114return history.Where(h => selectedTrainerNames.Contains(h.Pipeline.Trainer.TrainerName))
SweepableEstimator\MultiModelPipeline.cs (1)
80.Where(e => e is StringEntity se && se.Value != "Nil")
SweepableEstimator\SweepablePipeline.cs (3)
90.Where(e => e is StringEntity se && se.Value != "Nil") 111.Where(e => e is StringEntity se && se.Value != "Nil") 158.Where(e => e is StringEntity se && se.Value != "Nil")
TrainerExtensions\TrainerExtensionCatalog.cs (1)
107trainers = trainers.Where(t => allowList.Contains(GetTrainerName(t)));
TrainerExtensions\TrainerExtensionUtil.cs (4)
92var boosterParams = sweepParams.Where(p => _lightGbmBoosterParamNames.Contains(p.Name)); 170var boosterParams = sweepParams.Where(p => _lightGbmBoosterParamNames.Contains(p.Name)); 195props = props.Where(p => p.Key != LabelColumn && p.Key != WeightColumn) 229var parentProps = props.Where(p => p.Key != LightGbmBoosterPropName);
TransformInference\TransformInference.cs (2)
397var intermediateCols = columns.Where(c => c.Purpose != ColumnPurpose.Ignore) 452intermediateCols = intermediateCols.Where(c => c.Purpose == ColumnPurpose.NumericFeature ||
Tuner\AutoZeroTuner.cs (4)
39var trainerEstimators = _sweepablePipeline.Estimators.Where(e => e.Value.EstimatorType.IsTrainer()).Select(e => e.Value.EstimatorType.ToString()).ToList(); 87pipelineSchemas = _pipelineStrings.Where(kv => kv.Value.Contains(config.CatalogTransformer)); 94pipelineSchemas = pipelineSchemas.Where(kv => kv.Value.Contains(config.Trainer)); 98var trainerEstimatorName = pipeline.Estimators.Where(kv => kv.Value.EstimatorType.IsTrainer()).First().Key;
Tuner\PipelineProposer.cs (1)
200var estimatorTypes = entity.ValueEntities().Where(v => v is StringEntity s && s.Value != "Nil")
Utils\BestResultUtil.cs (3)
49results = results.Where(r => r.ValidationMetrics != null); 62results = results.Where(r => r.Results != null && r.Results.Any(x => x.ValidationMetrics != null)); 75results = results.Where(r => r.ValidationMetrics != null);
Microsoft.ML.AutoML.Samples (3)
Cifar10.cs (3)
19.Where(p => Path.GetExtension(p) == ".jpg") 26var testImages = imageInputs.Where(f => f.ImagePath.Contains("test")); 27var trainImages = imageInputs.Where(f => f.ImagePath.Contains("train"));
Microsoft.ML.AutoML.Tests (1)
Utils\TaskAgnosticIterationResult.cs (1)
81var propertiesToReport = metric.GetType().GetProperties().Where(p => p.PropertyType == typeof(double));
Microsoft.ML.CodeGenerator (6)
CodeGenerator\CSharp\AzureCodeGenerator\AzureAttachModelCodeGenerator.cs (1)
56var labelType = _columnInferenceResult.TextLoaderOptions.Columns.Where(t => t.Name == _settings.LabelName).First().DataKind;
CodeGenerator\CSharp\CodeGenerator.cs (3)
60var labelType = _columnInferenceResult.TextLoaderOptions.Columns.Where(t => t.Name == _settings.LabelName).First().DataKind; 223usings.AddRange(preTrainerTransformsAndUsings.Where(t => t.Item2 != null).SelectMany(t => t.Item2)); 224usings.AddRange(postTrainerTransformsAndUsings.Where(t => t.Item2 != null).SelectMany(t => t.Item2));
CodeGenerator\CSharp\PipelineExtension.cs (2)
41usings.AddRange(preTrainerTransformsAndUsings.Where(t => t.Item2 != null).SelectMany(t => t.Item2)); 42usings.AddRange(postTrainerTransformsAndUsings.Where(t => t.Item2 != null).SelectMany(t => t.Item2));
Microsoft.ML.Core (9)
CommandLine\CmdParser.cs (1)
1205Contracts.Assert(Args.Where(a => a.Index == argument.Index).Count() == 1);
ComponentModel\ComponentCatalog.cs (6)
741.Where(info => info.SignatureTypes.Contains(typeSig) && typeBase.IsAssignableFrom(info.Type)) 784.Where(ci => ci.LoadNames.Select(n => n.ToLowerInvariant().Trim()).Contains(name)) 793.Where(ci => ci.SignatureTypes.Contains(typeof(TSig))) 803.Where(ci => ci.ArgType == typeof(TArgs) && ci.SignatureTypes.Contains(typeof(TSig))) 920return _components.Where(x => x.Kind == kind).OrderBy(x => x.Name); 930return _components.Where(x => x.InterfaceType == interfaceType).OrderBy(x => x.Name);
Data\ProgressReporter.cs (1)
450unseen = _infos.Where(x => !seen.Contains(x.Index)).ToArray();
Environment\ConsoleEnvironment.cs (1)
189var checkpoints = entries.Where(
Microsoft.ML.Core.Tests (4)
UnitTests\CoreBaseTestClass.cs (2)
212var view2EvenCols = view2.Schema.Where(col => (col.Index & 1) == 0); 223var view2OddCols = view2.Schema.Where(col => (col.Index & 1) == 0);
UnitTests\TestVBuffer.cs (2)
141var indicies = Enumerable.Range(0, 15).Where(x => x % 2 == 0).ToArray(); 164var indicies = Enumerable.Range(0, 15).Where(x => x % 2 == 0).ToArray();
Microsoft.ML.Data (54)
Data\DataViewTypeManager.cs (2)
60typeAttributes = typeAttributes.Where(attr => attr.GetType().IsSubclassOf(typeof(DataViewTypeAttribute))); 95typeAttributes = typeAttributes.Where(attr => attr.GetType().IsSubclassOf(typeof(DataViewTypeAttribute)));
Data\SchemaDefinition.cs (5)
161.Where(x => x.GetCustomAttributes(typeof(CursorChannelAttribute), false).Any()) 166.Where(x => x.CanRead && x.CanWrite && x.GetGetMethod() != null && x.GetSetMethod() != null && x.GetIndexParameters().Length == 0) 167.Where(x => x.GetCustomAttributes(typeof(CursorChannelAttribute), false).Any()); 341.Where(x => (((direction & Direction.Read) == Direction.Read && (x.CanRead && x.GetGetMethod() != null)) || 391var customTypeAttributes = customAttributes.Where(x => x is DataViewTypeAttribute);
DataLoadSave\Binary\BinaryLoader.cs (3)
992int[] toSave = cols.Where(x => x.isSavable).Select(x => x.col).ToArray(); 993unsavableColIndices = cols.Where(x => !x.isSavable).Select(x => x.col).ToArray(); 2166.Where(t => !t.Value.IsGenerated).OrderBy(t => t.Value.ColumnIndex);
DataLoadSave\Binary\BinarySaver.cs (2)
587using (DataViewRowCursor cursor = data.GetRowCursor(data.Schema.Where(c => activeSet.Contains(c.Index)))) 745using (DataViewRowCursor cursor = data.GetRowCursor(data.Schema.Where(x => active.Contains(x.Index)), rand))
DataLoadSave\Database\DatabaseLoader.cs (1)
111.Where(x => x.CanRead && x.GetGetMethod() != null && x.GetIndexParameters().Length == 0);
DataLoadSave\Text\TextLoader.cs (1)
1579.Where(x => x.CanRead && x.GetGetMethod() != null && x.GetIndexParameters().Length == 0);
DataView\AppendRowsDataView.cs (1)
278var columnsNeeded = Schema.Where(col => IsColumnActive(col));
DataView\BatchDataViewMapperBase.cs (2)
44var inputCursor = _source.GetRowCursor(_source.Schema.Where(c => activeInput[c.Index]), null); 54var inputCols = _source.Schema.Where(c => predInput(c.Index));
DataView\CacheDataView.cs (2)
350cursor = _subsetInput.GetRowCursor(_subsetInput.Schema.Where(c => taskColumns.Contains(c.Index))); 663int[] actives = Enumerable.Range(0, _parent.Schema.Count).Where(pred).ToArray();
DataView\CompositeRowToRowMapper.cs (1)
78deps[deps.Length - 1] = OutputSchema.Where(c => activeIndices.Contains(c.Index));
DataView\LambdaFilter.cs (2)
119var inputCols = Source.Schema.Where(x => inputPred(x.Index)); 132var inputCols = Source.Schema.Where(x => inputPred(x.Index));
DataView\RowToRowMapperTransform.cs (1)
163inputColumns = _bindings.InputSchema.Where(col => activeInput[col.Index] || predicateIn(col.Index));
DataView\Transposer.cs (3)
102columnSet = columnSet.Where(c => _tview.GetSlotType(c) == null); 838var inputCols = _input.Schema.Where(x => srcPred(x.Index)); 851var srcCols = columnsNeeded.Where(x => srcPred(x.Index));
DataView\TypedCursor.cs (2)
186var inputCols = _data.Schema.Where(x => deps(x.Index)); 208var inputs = _data.GetRowCursorSet(_data.Schema.Where(col => _columnIndices.Contains(col.Index) || additionalColumnsPredicate(col.Index)), n, rand);
DataView\ZipDataView.cs (1)
88.Select((dv, i) => srcPredicates[i] == null ? GetMinimumCursor(dv) : dv.GetRowCursor(dv.Schema.Where(x => srcPredicates[i](x.Index)), null)).ToArray();
Deprecated\Instances\HeaderSchema.cs (1)
107var items = map.Where(kvp => 0 <= kvp.Key && kvp.Key < count && kvp.Value != null);
Dirty\ChooseColumnsByIndexTransform.cs (2)
253var inputCols = Source.Schema.Where(x => inputPred(x.Index)); 267var inputCols = Source.Schema.Where(x => inputPred(x.Index));
EntryPoints\EntryPointNode.cs (5)
343return _vars.Values.Where(x => x.HasInputs && !x.HasOutputs && !x.IsValueSet) 789return _inputMap.Where(kv => !_inputBuilder.IsInputOptional(kv.Key.ParameterName)).Select(kv => kv.Value).Distinct() 907var unexpectedFields = node.Properties().Where( 1000public IEnumerable<EntryPointNode> Macros => _nodes.Where(x => x.IsMacro); 1001public IEnumerable<EntryPointNode> NonMacros => _nodes.Where(x => !x.IsMacro);
Evaluators\AnomalyDetectionEvaluator.cs (1)
726using (var cursor = overall.GetRowCursor(overall.Schema.Where(col => col.Name.Equals(AnomalyDetectionEvaluator.OverallMetrics.NumAnomalies) ||
Evaluators\EvaluatorBase.cs (1)
144var activeCols = data.Schema.Where(x => activeColsIndices(x.Index));
Evaluators\EvaluatorUtils.cs (1)
1476using (var cursor = confusionDataView.GetRowCursor(confusionDataView.Schema.Where(col => col.Index == countIndex || hasStrat && col.Index == stratCol)))
Scorers\RowToRowScorerBase.cs (1)
104var activeInCols = bindings.Input.Where(c => c.Index < activeInput.Length && activeInput[c.Index]);
Transforms\ColumnSelecting.cs (3)
142var columns = inputSchema.Where(c => _selectPredicate(c.Name)); 463var missing = selectColumns.Where(x => !inputColumns.Contains(x)); 722return _mapper.InputSchema.Where(col => col.Index < active.Length && active[col.Index]);
Transforms\GenerateNumberTransform.cs (2)
345var inputCols = Source.Schema.Where(x => inputPred(x.Index)); 356var inputCols = Source.Schema.Where(x => inputPred(x.Index));
Transforms\NAFilter.cs (2)
214var inputCols = Source.Schema.Where(x => inputPred(x.Index)); 226var inputCols = Source.Schema.Where(x => inputPred(x.Index));
Transforms\PerGroupTransformBase.cs (2)
176var activeCols = Source.Schema.Where(x => activeInput.Length > x.Index && activeInput[x.Index]); 191var cols = Source.Schema.Where(x => predInput(x.Index));
Transforms\RangeFilter.cs (2)
214var inputCols = Source.Schema.Where(x => inputPred(x.Index)); 228var inputCols = Source.Schema.Where(x => inputPred(x.Index));
Transforms\TransformBase.cs (1)
447return Input.Where(col => col.Index < active.Length && active[col.Index]);
Transforms\ValueToKeyMappingTransformer.cs (1)
587using (var cursor = trainingData.GetRowCursor(trainingData.Schema.Where(c => toTrain.Contains(c.Index))))
Microsoft.ML.Ensemble (4)
PipelineEnsemble.cs (1)
100return InputSchema.Where(col => _inputColIndices.Contains(col.Index));
Selector\SubModelSelector\BaseBestPerformanceSelector.cs (1)
42return sortedModels.Where(m => m != null).Take(modelCountToBeSelected).ToList();
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 (1)
175var modelsList = batchModels.Where(m => m != null).ToList();
Microsoft.ML.Fairlearn (1)
Metrics\FairlearnMetricCatalog.cs (1)
226}).Where(x => x != null));
Microsoft.ML.FastTree (6)
FastTree.cs (2)
1575FeatureMap = Enumerable.Range(0, NumFeatures).Where(f => BinUpperBounds[f].Length > 1).ToArray(); 2040FeatureMap = Enumerable.Range(0, NumFeatures).Where(f => BinUpperBounds[f].Length > 1).ToArray();
GamModelParameters.cs (1)
472var goodLines = ini.Split(new[] { '\n' }).Where(line => !line.StartsWith("SplitGain="));
Training\DcgCalculator.cs (2)
166Parallel.ForEach(Enumerable.Range(0, dataset.NumQueries).Where(query => maxDCG3[query] > 0), 267Parallel.ForEach(Enumerable.Range(0, dataset.NumQueries).Where(query => maxDCG1[query] > 0),
Training\OptimizationAlgorithms\GradientDescent.cs (1)
50Enumerable.Range(0, numberOfTrees).Where(t => (DropoutRng.NextDouble() < DropoutRate)).ToArray();
Microsoft.ML.GenAI.Core (3)
Extension\ModuleExtension.cs (2)
152var childrenDeviceMap = deviceMap.Where(x => x.Key.StartsWith($"{key}.")).ToDictionary(x => x.Key.Substring($"{key}.".Length), x => x.Value); 180var remainingLayerSizeMap = layerSizeMap.Where(x => !deviceMap.ContainsKey(x.Key)).ToDictionary(x => x.Key, x => x.Value);
Pipeline\CausalLMPipeline.cs (1)
264stopTokenIds = stopTokenIds.Where(ids => ids.Count() > 0).ToList();
Microsoft.ML.GenAI.Mistral (1)
Mistral_7B_0_3ChatTemplateBuilder.cs (1)
30if (messages.Where(m => m.GetRole() == Role.System).Count() > 1)
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (2)
73var sameNameNodes = argList.DescendantTokens().Where(tok => tok.Text == nameArgValue) 74.Select(p => p.Parent).Where(n => n.IsKind(SyntaxKind.IdentifierName));
Microsoft.ML.Mkl.Components (1)
VectorWhitening.cs (1)
335using (var cursor = inputData.GetRowCursor(inputData.Schema.Where(c => cols.Any(col => c.Index == col))))
Microsoft.ML.OnnxTransformer (4)
OnnxTransform.cs (4)
525if (inputShape.Where(x => x == 0).Count() > 1) 557int valCount = inputShape.Where(x => x > 0).Aggregate((x, y) => x * y); 883_denominator = _tensorShape.Where(x => x > 0).Aggregate((a, x) => a * x); 1065if (Transformer.Model.ModelInfo.InputsInfo[i].Shape.Where(x => x == 0).Count() > 1)
Microsoft.ML.Parquet (1)
PartitionedFileLoader.cs (1)
401_subActivecolumnsNeeded = Schema.Where(x => (_subActive?.Length > x.Index) && _subActive[x.Index]);
Microsoft.ML.PCA (1)
PcaTransformer.cs (1)
416var inputCols = trainingData.Schema.Where(x => activeColumns[x.Index]);
Microsoft.ML.PerformanceTests (1)
Harness\ProjectGenerator.cs (1)
70return string.Join(Environment.NewLine, File.ReadAllLines(csproj.FullName).Where(line => line.Contains("<NativeAssemblyReference")));
Microsoft.ML.Predictor.Tests (2)
TestPredictors.cs (2)
700var cols = scored.Schema.Where(c => c.Name.Equals("Score") || c.Name.Equals("Probability") || c.Name.Equals("PredictedLabel")); 881var cols = scored.Schema.Where(c => c.Name.Equals("Score") || c.Name.Equals("Probability") || c.Name.Equals("PredictedLabel"));
Microsoft.ML.Recommender (1)
MatrixFactorizationPredictor.cs (1)
370return InputSchema.Where(col => col.Index == _matrixColumnIndexColumnIndex || col.Index == _matrixRowIndexCololumnIndex);
Microsoft.ML.Samples (3)
Dynamic\Trainers\Recommendation\OneClassMatrixFactorizationWithOptions.cs (1)
113var topColumns = results.Where(element => element.MatrixRowIndex == 1)
Dynamic\Trainers\Regression\LightGbmAdvanced.cs (1)
37.Where(name => name != labelName) // Drop the Label
Dynamic\Trainers\Regression\LightGbmWithOptionsAdvanced.cs (1)
38.Where(name => name != labelName) // Drop the Label
Microsoft.ML.SearchSpace (1)
Parameter.cs (1)
195.Where(p => p.CanRead && p.CanWrite);
Microsoft.ML.StandardTrainers (2)
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (1)
148return InputSchema.Where(col => _inputColumnIndexes.Contains(col.Index));
Standard\LinearPredictorUtils.cs (1)
211.Where(weight => Math.Abs(weight.Value) >= Epsilon)
Microsoft.ML.Sweeper (3)
Algorithms\KdoSweeper.cs (3)
138var viableRuns = prevRuns.Cast<RunResult>().Where(run => run != null && run.HasMetricValue).Cast<IRunResult>().ToArray(); 379previousRuns.Cast<RunResult>().Where(r => r.HasMetricValue).Max(r => r.MetricValue) : 380previousRuns.Cast<RunResult>().Where(r => r.HasMetricValue).Min(r => r.MetricValue);
Microsoft.ML.TensorFlow (2)
TensorflowTransform.cs (2)
723var tensorSize = tensor.TensorShape.dims.Where(x => x > 0).Aggregate((x, y) => x * y); 738var tensorSize = tensor.TensorShape.dims.Where(x => x > 0).Aggregate((x, y) => x * y);
Microsoft.ML.TestFramework (5)
BaseTestPredictorsMaml.cs (2)
155string runcmd = string.Join(" ", args.Where(a => !string.IsNullOrWhiteSpace(a))); 256runcmd = string.Join(" ", args.Where(a => !string.IsNullOrWhiteSpace(a)));
DataPipe\TestDataPipeBase.cs (2)
669var view2EvenCols = view2.Schema.Where(col => (col.Index & 1) == 0); 680var view2OddCols = view2.Schema.Where(col => (col.Index & 1) != 0);
TestCommandBase.cs (1)
401var paths = toCompare.Where(pa => (pa.CmpUsage & situation) != PathArgument.Usage.None).ToArray();
Microsoft.ML.Tests (2)
Scenarios\Api\TestApi.cs (1)
272.Where(line => !string.IsNullOrEmpty(line) && !line.StartsWith("//"))
TrainerEstimators\MatrixFactorizationTests.cs (1)
701var topColumns = results.Where(element => element.MatrixRowIndex == 1).OrderByDescending(element => element.Score).Take(2);
Microsoft.ML.TorchSharp (6)
AutoFormerV2\ObjectDetectionMetrics.cs (3)
68objectLabelList.Where(objLabel => objLabel.Confidence >= scoreThreshold).ToList()); 120int gt = groundTruthBoxes.Where(k => k.Value != 0).Count(); 138int gt = groundTruthBoxes.Where(k => k.Value != 0).Count();
NasBert\NasBertTrainer.cs (1)
188var parameters = Model.parameters().Where(p => p.requires_grad);
NasBert\Optimizers\BaseOptimizer.cs (1)
67.Where(grad => grad.IsNotNull()) // parameters unused have no gradient
Roberta\QATrainer.cs (1)
218var parameters = Model.parameters().Where(p => p.requires_grad);
Microsoft.ML.Transforms (6)
CustomMappingFilter.cs (2)
44var inputCols = Input.Schema.Where(x => inputPred(x.Index)); 80var inputCols = Input.Schema.Where(x => inputPred(x.Index));
GroupTransform.cs (2)
599foreach (var agg in _aggregators.Where(x => x != null)) 607foreach (var agg in _aggregators.Where(x => x != null))
MutualInformationFeatureSelection.cs (1)
195CreateDropAndCopyColumns(colArr.Length, scores, threshold, tiedScoresToKeep, _columns.Where(col => colSet.Contains(col.inputColumnName)).ToArray(), out int[] selectedCount, out dropSlotsColumns, out copyColumnPairs);
SvmLight\SvmLightSaver.cs (1)
162foreach (var pair in features.Items().Where(p => p.Value != 0))
Microsoft.ML.Vision (4)
DnnRetrainTransform.cs (3)
330var cols = input.Schema.Where(c => inputColIndices.Contains(c.Index)); 894var tensorSize = tensor.TensorShape.dims.Where(x => x > 0).Aggregate((x, y) => x * y); 909var tensorSize = tensor.TensorShape.dims.Where(x => x > 0).Aggregate((x, y) => x * y);
ImageClassificationTrainer.cs (1)
833input.Schema.Where(c => c.Index == labelColumn.Index || c.Index == imageColumn.Index)))
Microsoft.NET.StringTools (1)
WeakStringCacheInterner.cs (1)
152.Where(kv => kv.Value > 1)
Microsoft.NET.StringTools.net35 (1)
WeakStringCacheInterner.cs (1)
152.Where(kv => kv.Value > 1)
Microsoft.VisualStudio.LanguageServices (30)
CallHierarchy\Finders\BaseMemberFinder.cs (1)
32return calls.Where(c => c.IsDirect);
CallHierarchy\Finders\FieldReferenceFinder.cs (1)
35return callers.Where(c => c.IsDirect);
CallHierarchy\Finders\InterfaceImplementationCallFinder.cs (1)
35return calls.Where(c => c.IsDirect);
CallHierarchy\Finders\MethodCallFinder.cs (1)
38return callers.Where(c => c.IsDirect);
ChangeSignature\ChangeSignatureDialogViewModel.cs (3)
283_parametersWithoutDefaultValues.Where(p => !p.IsRemoved).Select(p => p.Parameter).ToImmutableArray(), 284_parametersWithDefaultValues.Where(p => !p.IsRemoved).Select(p => p.Parameter).ToImmutableArray(), 354foreach (var parameter in AllParameters.Where(p => !p.IsRemoved))
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (2)
103.Where(p => p.Language is LanguageNames.CSharp or LanguageNames.VisualBasic) 104.Where(p => _workspace.GetHierarchy(p.Id) == hierarchy);
GenerateType\GenerateTypeDialogViewModel.cs (4)
376if (this.SelectedProject.Documents.Where(n => n != null).Where(n => n.FilePath == FullFilePath).Any() || 378this.SelectedProject.Documents.Where(n => n.Name != null && n.Folders.Count > 0 && n.Name == this.FileName && this.Folders.SequenceEqual(n.Folders)).Any()) || 740.Where(p => p != document.Project && !dependencyGraph.GetProjectsThatThisProjectTransitivelyDependsOn(p.Id).Contains(document.Project.Id))
Implementation\HierarchyItemToProjectIdMap.cs (1)
38.Where(p =>
Interactive\VsInteractiveWindowProvider.cs (2)
151var interactiveCommands = commands.Where( 156var specializedInteractiveCommands = commands.Where(
PickMembers\PickMembersDialogViewModel.cs (1)
56: _allMembers.Where(m => m.SymbolAutomationText.IndexOf(searchText, StringComparison.OrdinalIgnoreCase) >= 0).ToList();
PickMembers\VisualStudioPickMembersService.cs (1)
41viewModel.MemberContainers.Where(c => c.IsChecked)
Preview\PreviewUpdater.Tagger.cs (1)
48var lines = _textBuffer.CurrentSnapshot.Lines.Where(line => line.Extent.OverlapsWith(_span));
Progression\GraphQueries\IsCalledByGraphQuery.cs (1)
33foreach (var caller in callers.Where(c => c.IsDirect))
Progression\GraphQueries\IsUsedByGraphQuery.cs (1)
35.Where(l => l != null && l.IsInSource);
ProjectSystem\VisualStudioProjectManagementService.cs (1)
74projectItems.OfType<ProjectItem>().Where(n => n.IsFolder()).Do(n => projectItemsStack.Push(Tuple.Create(n, "\\")));
ProjectSystem\VisualStudioWorkspaceImpl.cs (1)
326.Where(CanApplyChange).ToList();
SyncNamespaces\SyncNamespacesCommandHandler.cs (2)
109.Where(project => project.Language.Equals(LanguageNames.CSharp, StringComparison.OrdinalIgnoreCase)) 122.Where(project => project.FilePath?.Equals(projectFilePath, StringComparison.OrdinalIgnoreCase) == true)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
469foreach (var diagnosticData in diagnosticsToFix.Where(IsDocumentDiagnostic)) 561foreach (var diagnosticData in diagnosticsToFix.Where(IsProjectDiagnostic))
Venus\ContainedDocument.cs (2)
708.Where(ss => ss.Snapshot.TextBuffer == subjectBuffer) 816var newChanges = FilterTextChanges(document.GetTextSynchronously(CancellationToken.None), visibleSpans, changes.ToReadOnlyCollection()).Where(t => visibleSpan.Contains(t.Span));
Workspace\VisualStudioFormattingRuleFactoryServiceFactory.cs (1)
110return changes.Where(c => span.IntersectsWith(c.Span));
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (1)
36.Where(n => !n.IsKind(SyntaxKind.IncompleteMember))
CodeModel\CSharpCodeModelService.cs (1)
444return GetMemberNodesWorker(container, includeSelf, recursive, logicalFields, onlySupportedNodes).Where(t => t is not RecordDeclarationSyntax);
ProjectSystemShim\TempPECompilerService.cs (1)
59parsedArguments.ResolveMetadataReferences(metadataResolver).Where(m => m is not UnresolvedMetadataReference),
Snippets\CSharpSnippetExpansionLanguageHelper.cs (1)
97if (TryAddImportsToContainedDocument(document, newUsingDirectives.Where(u => u.Alias == null).Select(u => u.Name!.ToString())))
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
UnifiedSettings\CSharpUnifiedSettingsTests.cs (2)
46return allValues.Where(value => !value.Equals(SnippetsRule.Default)).ToArray(); 52return allValues.Where(value => !value.Equals(EnterKeyRule.Default)).ToArray();
Microsoft.VisualStudio.LanguageServices.LiveShare (2)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (2)
76.Where(f => f.Scheme != SystemUriSchemeExternal) 77.Where(f => !_secondaryBufferFileExtensions.Any(ext => f.LocalPath.EndsWith(ext)))
Microsoft.VisualStudio.LanguageServices.Xaml (2)
Implementation\LanguageServer\Extensions\SolutionExtensions.cs (1)
15=> solution.Projects.Where(p => p.Language == StringConstants.XamlLanguageName);
Implementation\LanguageServer\Handler\Hover\HoverHandler.cs (1)
97=> string.Join("\r\n", description.Select(section => section.Text).Where(text => !string.IsNullOrEmpty(text)));
MSBuild (3)
BuildEnvironmentHelper.cs (1)
299.Where(i => i.Version.Major == v.Major && FileSystems.Default.DirectoryExists(i.Path))
CopyOnWriteDictionary.cs (1)
221return _backing.Where(predicate);
XMake.cs (1)
3163? commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.InputResultsCaches].Where(p => p != null).ToArray()
MSBuildTaskHost (2)
BuildEnvironmentHelper.cs (1)
299.Where(i => i.Version.Major == v.Major && FileSystems.Default.DirectoryExists(i.Path))
CopyOnWriteDictionary.cs (1)
221return _backing.Where(predicate);
Mvc.RoutingWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
31.Where(kvp => kvp.Key != "link" && kvp.Key != "link_action" && kvp.Key != "link_controller")
PrepareTests (1)
TestDiscovery.cs (1)
147var assemblies = unitTestAssemblies.Concat(integrationTestAssemblies).Where(ShouldInclude);
Roslyn.Test.PdbUtilities (2)
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (2)
103MetadataReader.GetEditAndContinueLogEntries().Where(e => IsDefinition(e.Handle.Kind)), itemInspector: EncLogRowToString, message: GetAssertMessage("EncLog definitions don't match")); 111MetadataReader.GetEditAndContinueMapEntries().Where(e => IsDefinition(e.Kind)), itemInspector: EncMapRowToString, message: GetAssertMessage("EncMap definitions don't match"));
Roslyn.VisualStudio.DiagnosticsWindow (4)
OptionPages\InternalOptionsControl.cs (2)
83checkAllButton.Click += (o, a) => optionsPanel.Children.OfType<CheckBox>().Where(c => c.Visibility == Visibility.Visible).Do(c => c.IsChecked = true); 86uncheckAllButton.Click += (o, a) => optionsPanel.Children.OfType<CheckBox>().Where(c => c.Visibility == Visibility.Visible).Do(c => c.IsChecked = false);
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)
70.Where(s => spans.Any(ss => ss.IntersectsWith(s)))
Roslyn.VisualStudio.Next.UnitTests (1)
Services\PerformanceTrackerServiceTests.cs (1)
260return assembly.GetManifestResourceNames().Where(n => n.EndsWith(convert, StringComparison.OrdinalIgnoreCase)).First();
RunTests (5)
AssemblyScheduler.cs (2)
169var unmatchedRemoteTests = testHistory.Keys.Where(type => !matchedRemoteTests.Contains(type)); 199var singlePartitionAssemblies = typeInfos.Where(kvp => ShouldPartitionInSingleWorkItem(kvp.Key.AssemblyPath));
ProcessTestExecutor.cs (1)
60var filters = workItem.Filters.Values.SelectMany(filter => filter).Where(filter => !string.IsNullOrEmpty(filter.FullyQualifiedName)).ToImmutableArray();
TestRunner.cs (2)
418foreach (var testResult in testResults.Where(x => !x.Succeeded)) 441foreach (var testResult in testResults.Where(x => !string.IsNullOrEmpty(x.Diagnostics)))
Sockets.BindTests (16)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6ScopeIdPresentConditionAttribute.cs (1)
25.Where(iface => iface.OperationalStatus == OperationalStatus.Up)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (15)
1021.Where(ip => ip.AddressFamily == AddressFamily.InterNetwork) 1022.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1066.Where(ip => ip.AddressFamily == AddressFamily.InterNetwork) 1067.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1076.Where(ip => ip.AddressFamily == AddressFamily.InterNetworkV6) 1077.Where(ip => ip.ScopeId == 0) 1078.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1123.Where(ip => !ip.Equals(IPAddress.IPv6Loopback)) 1124.Where(ip => ip.AddressFamily == AddressFamily.InterNetworkV6) 1125.Where(ip => ip.ScopeId == 0) 1126.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1160.Where(ip => ip.AddressFamily == AddressFamily.InterNetworkV6) 1161.Where(ip => ip.ScopeId != 0) 1162.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1180.Where(i => i.OperationalStatus == OperationalStatus.Up)
Sockets.FunctionalTests (11)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6ScopeIdPresentConditionAttribute.cs (1)
25.Where(iface => iface.OperationalStatus == OperationalStatus.Up)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (3)
928Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Connections" && 1038Assert.Single(TestSink.Writes.Where(c => c.EventId.Name == "ConnectionStop")); 1090Assert.Single(TestSink.Writes.Where(c => c.EventId.Name == "ConnectionStop"));
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (7)
399var presShutdownTransportLogs = TestSink.Writes.Where( 401var connectionResetLogs = presShutdownTransportLogs.Where( 411var coreLogs = TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Connections"); 412Assert.Single(coreLogs.Where(w => w.EventId == connectionStopEventId)); 414var transportLogs = TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel" || 451var transportLogs = TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets"); 455var coreLogs = TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel");
Swaggatherer (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
System.Collections.Immutable (1)
System\Linq\ImmutableArrayExtensions.cs (1)
89return immutableArray.array!.Where(predicate);
System.ComponentModel.Composition (18)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogChangeProxy.cs (1)
39var trimmedExports = originalExports.Where(partAndExport =>
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (1)
804foreach (var import in definition.ImportDefinitions.Where(ImportEngine.IsRequiredImportForPreview))
System\ComponentModel\Composition\Hosting\CompositionServices.cs (1)
481Where(property => property.GetFirstAttribute<DefaultValueAttribute>() == null).
System\ComponentModel\Composition\Hosting\FilteredCatalog.cs (3)
92return _innerCatalog.Where(_filter).GetEnumerator(); 216e.AddedDefinitions.Where(_filter), 217e.RemovedDefinitions.Where(_filter),
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependenciesTraversal.cs (1)
62foreach (ImportDefinition import in part.ImportDefinitions.Where(_importFilter))
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependentsTraversal.cs (1)
81foreach (ImportDefinition import in candidateReachablePart.ImportDefinitions.Where(_importFilter))
System\ComponentModel\Composition\Hosting\FilteredCatalog.Traversal.cs (1)
71var traversalClosure = GetTraversalClosure(_innerCatalog.Where(_filter), traversal);
System\ComponentModel\Composition\Hosting\ImportEngine.cs (3)
307var requiredImports = part.ImportDefinitions.Where(IsRequiredImportForPreview); 344var prereqImports = part.ImportDefinitions.Where(import => import.IsPrerequisite); 355var requiredImports = part.ImportDefinitions.Where(import => !import.IsPrerequisite);
System\ComponentModel\Composition\Hosting\ImportEngine.RecompositionManager.cs (1)
52return part.ImportDefinitions.Where(import => IsAffectedImport(import, changedExports));
System\ComponentModel\Composition\ReflectionModel\LazyMemberInfo.cs (2)
176if (accessors.Where(accessor => (accessor != null) && (accessor.MemberType != MemberTypes.Method)).Any()) 191if (accessors.Where(accessor => (accessor != null) && (accessor.MemberType != MemberTypes.Method)).Any())
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (3)
370foreach (ImportDefinition definition in ImportDefinitions.Where(definition => definition.IsPrerequisite)) 448IEnumerable<ImportDefinition> members = ImportDefinitions.Where(import => !import.IsPrerequisite); 456IEnumerable<ImportDefinition> members = ImportDefinitions.Where(import => import.IsPrerequisite);
System.ComponentModel.Composition.Registration (1)
System\ComponentModel\Composition\Registration\RegistrationBuilder.cs (1)
109foreach (PartBuilder builder in _conventions.Where(c => c.SelectType(type.UnderlyingSystemType)))
System.Composition.Convention (1)
System\Composition\Convention\ConventionBuilder.cs (1)
134foreach (PartConventionBuilder builder in _conventions.Where(c => c.SelectType(type)))
System.Composition.Hosting (1)
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (1)
53.Where(prop =>
System.Composition.TypedParts (12)
System\Composition\CompositionContextExtensions.cs (1)
81var importsSatisfiedMethods = objectWithLooseImports.GetType().GetRuntimeMethods().Where(m =>
System\Composition\Hosting\SinglePartExportDescriptorProvider.cs (1)
30var subsetOfConstraints = contract.MetadataConstraints.Where(c => Metadata.ContainsKey(c.Key)).ToDictionary(c => c.Key, c => Metadata[c.Key]);
System\Composition\TypedParts\ActivationFeatures\OnImportsSatisfiedFeature.cs (1)
42.Where(mi => _attributeContext.GetDeclaredAttribute<OnImportsSatisfiedAttribute>(mi.DeclaringType, mi) != null);
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (2)
31.Where(pi => pi.CanWrite && pi.SetMethod.IsPublic && !(pi.SetMethod.IsStatic)) 68.Where(dep => dep.Site is PropertyImportSite)
System\Composition\TypedParts\ContractHelpers.cs (1)
73.Where(p => p.GetMethod.IsPublic && p.DeclaringType == attrType && p.CanRead))
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (3)
77.Where(a => a != null) 87foreach (var c in _partType.DeclaredConstructors.Where(ci => ci.IsPublic && !(ci.IsStatic))) 175.Where(dep => dep.Site is ParameterImportSite)
System\Composition\TypedParts\Discovery\TypeInspector.cs (2)
79.Where(pi => pi.CanRead && pi.GetMethod.IsPublic && !pi.GetMethod.IsStatic)) 158.Where(p => p.DeclaringType == attrType && p.CanRead))
System\Composition\TypedParts\TypedPartExportDescriptorProvider.cs (1)
89var subsettedConstraints = contract.MetadataConstraints.Where(c => export.Metadata.ContainsKey(c.Key)).ToDictionary(c => c.Key, c => export.Metadata[c.Key]);
System.Data.Common (2)
System\Data\EnumerableRowCollectionExtensions.cs (1)
22EnumerableRowCollection<TRow> edt = new EnumerableRowCollection<TRow>(source, Enumerable.Where(source, predicate), selector: null);
System\Data\TypeLimiter.cs (1)
203m_allowedTypes = new HashSet<Type>(allowedTypes.Where(type => type != null));
System.Linq.Expressions (2)
System\Dynamic\Utils\TypeUtils.cs (1)
16.Where(i => i.IsGenericType)
System\Linq\Expressions\Compiler\CompilerScope.cs (1)
296ReadOnlyCollection<ParameterExpression> hoistedVars = GetVariables().Where(p => Definitions[p] == VariableStorageKind.Hoisted).ToReadOnly();
System.Linq.Parallel (1)
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (1)
85return wrappedChild.Where(_predicate);
System.Linq.Queryable (5)
System\Linq\EnumerableRewriter.cs (5)
176.Where(i => i.IsGenericType && i.GenericTypeArguments.Length == 1) 180.Where(i => i.GenType == typeof(IOrderedQueryable<>) || i.GenType == typeof(IOrderedEnumerable<>)) 189.Where(i => i.GenType == typeof(IQueryable<>) || i.GenType == typeof(IEnumerable<>)) 223.Where(m => ArgsMatch(m, args, typeArgs)) 299using (IEnumerator<MethodInfo> en = type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).Where(m => m.Name == name).GetEnumerator())
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\CollectionDataContract.cs (3)
996Type? t = type.GetInterfaces().Where(it => it.Equals(interfaceType)).FirstOrDefault(); 1293Type? t = type.GetInterfaces().Where(it => it.Equals(interfaceType)).FirstOrDefault(); 1350interfaceType.GetInterfaces().Where(t => t.FullName!.StartsWith("System.Collections.Generic.IEnumerable")).FirstOrDefault() ??
System.Private.Windows.Core.TestUtilities (5)
DebuggerAttributes.cs (4)
70.Where(fi => fi.IsPublic && GetDebuggerBrowsableState(fi) != DebuggerBrowsableState.Never); 78.Where(pi => pi.GetGetMethod() is not null && GetDebuggerBrowsableState(pi) != DebuggerBrowsableState.Never); 93.Where(a => a.AttributeType == typeof(DebuggerTypeProxyAttribute)) 119.Where(a => a.AttributeType == typeof(DebuggerDisplayAttribute))
ReflectionHelper.cs (1)
12var types = typeof(T).Assembly.GetTypes().Where(IsPublicNonAbstract<T>);
System.Text.Json.SourceGeneration (3)
JsonSourceGenerator.Parser.cs (2)
1730IMethodSymbol[] publicCtors = namedType.GetExplicitlyDeclaredInstanceConstructors().Where(ctor => ctor.DeclaredAccessibility is Accessibility.Public).ToArray(); 1756foreach (IMethodSymbol constructor in namedType.GetExplicitlyDeclaredInstanceConstructors().Where(ctor => ctor.DeclaredAccessibility is not Accessibility.Public))
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithSimpleName.cs (1)
102.Where(info => info.ContainsGlobalAliases || info.ContainsAttributeList))
System.Windows.Forms (5)
System\Resources\AssemblyNamesTypeResolutionService.cs (1)
39foreach (AssemblyName assemblyName in _names.Where(an => an.Equals(name)))
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogPage.cs (4)
871_boundCustomButtons = buttons.Where(e => !e.IsStandardButton).ToArray(); 873buttons.Where(e => e.IsStandardButton) 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\Windows\Forms\Design\ControlDesigner.cs (1)
2485stack = string.Join(Environment.NewLine, exceptionLines.Where(l => l.Contains(typeName)));
System.Windows.Forms.Design.Tests (3)
EnsureDesignerTests.cs (1)
18.Where(t => t.IsSubclassOf(typeof(ComponentDesigner))
EnsureEditorsTests.cs (1)
30.Where(t => t.IsSubclassOf(typeof(UITypeEditor))
System\Windows\Forms\Design\EmbeddedResourceTests.cs (1)
83new(ExpectedIconNamesString.Split(Environment.NewLine).Where(item => !item.EndsWith(".bmp", StringComparison.Ordinal)));
System.Windows.Forms.Tests (5)
System\Windows\Forms\ApplicationContextTests.cs (1)
389Where(type => type == typeof(ApplicationContext) || type.IsSubclassOf(typeof(ApplicationContext))))
System\Windows\Forms\AxWebBrowserTests.cs (2)
41.Where(prop => prop.ComponentType.Assembly.GetName().Name == assemblyNameFromType) 47.Where(ev => ev.ComponentType.Assembly.GetName().Name == assemblyNameFromType)
System\Windows\Forms\DataGridViewElementTests.cs (1)
35foreach (var type in typeof(DataGridViewElement).Assembly.GetTypes().Where(type =>
System\Windows\Forms\PowerStatusTests.cs (1)
34.Where(v => v != BatteryChargeStatus.Unknown)
TaskUsageLogger (2)
TaskUsageLogger.cs (2)
341UsingTaskData matchingData = usingTasks.Where(ut => IsPartialNameMatch(taskName, ut.TaskName)).FirstOrDefault(); 359matchingData = defaultUsingTasks.Where(ut => IsPartialNameMatch(taskName, ut.TaskName)).FirstOrDefault();
Templates.Blazor.Tests (12)
src\ProjectTemplates\Shared\Project.cs (1)
271var file = Directory.EnumerateFiles(fullPath).Where(f => f.EndsWith($"{migration}.cs", StringComparison.Ordinal)).FirstOrDefault();
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (6)
96.Where(c => HasOid(c, AspNetHttpsOid)); 110.Where(c => IsValidCertificate(c, now, requireExportable)) 153.Where(e => string.Equals(AspNetHttpsOid, e.Oid?.Value, StringComparison.Ordinal)) 200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
Templates.Blazor.WebAssembly.Auth.Tests (14)
src\ProjectTemplates\Shared\Project.cs (1)
271var file = Directory.EnumerateFiles(fullPath).Where(f => f.EndsWith($"{migration}.cs", StringComparison.Ordinal)).FirstOrDefault();
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (6)
96.Where(c => HasOid(c, AspNetHttpsOid)); 110.Where(c => IsValidCertificate(c, now, requireExportable)) 153.Where(e => string.Equals(AspNetHttpsOid, e.Oid?.Value, StringComparison.Ordinal)) 200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
src\Shared\E2ETesting\E2ETestOptions.cs (1)
26.Where(ama => ama.Key.StartsWith(TestingOptionsPrefix, StringComparison.Ordinal))
src\Shared\E2ETesting\WebDriverExtensions.cs (1)
23var logs = log.Where(entry => entry.Level >= level && !ShouldIgnore(entry)).ToList();
Templates.Blazor.WebAssembly.Tests (14)
src\ProjectTemplates\Shared\Project.cs (1)
271var file = Directory.EnumerateFiles(fullPath).Where(f => f.EndsWith($"{migration}.cs", StringComparison.Ordinal)).FirstOrDefault();
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (6)
96.Where(c => HasOid(c, AspNetHttpsOid)); 110.Where(c => IsValidCertificate(c, now, requireExportable)) 153.Where(e => string.Equals(AspNetHttpsOid, e.Oid?.Value, StringComparison.Ordinal)) 200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
src\Shared\E2ETesting\E2ETestOptions.cs (1)
26.Where(ama => ama.Key.StartsWith(TestingOptionsPrefix, StringComparison.Ordinal))
src\Shared\E2ETesting\WebDriverExtensions.cs (1)
23var logs = log.Where(entry => entry.Level >= level && !ShouldIgnore(entry)).ToList();
Templates.Mvc.Tests (14)
src\ProjectTemplates\Shared\Project.cs (1)
271var file = Directory.EnumerateFiles(fullPath).Where(f => f.EndsWith($"{migration}.cs", StringComparison.Ordinal)).FirstOrDefault();
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (6)
96.Where(c => HasOid(c, AspNetHttpsOid)); 110.Where(c => IsValidCertificate(c, now, requireExportable)) 153.Where(e => string.Equals(AspNetHttpsOid, e.Oid?.Value, StringComparison.Ordinal)) 200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
src\Shared\E2ETesting\E2ETestOptions.cs (1)
26.Where(ama => ama.Key.StartsWith(TestingOptionsPrefix, StringComparison.Ordinal))
src\Shared\E2ETesting\WebDriverExtensions.cs (1)
23var logs = log.Where(entry => entry.Level >= level && !ShouldIgnore(entry)).ToList();
Templates.Tests (14)
src\ProjectTemplates\Shared\Project.cs (1)
271var file = Directory.EnumerateFiles(fullPath).Where(f => f.EndsWith($"{migration}.cs", StringComparison.Ordinal)).FirstOrDefault();
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (6)
96.Where(c => HasOid(c, AspNetHttpsOid)); 110.Where(c => IsValidCertificate(c, now, requireExportable)) 153.Where(e => string.Equals(AspNetHttpsOid, e.Oid?.Value, StringComparison.Ordinal)) 200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
src\Shared\E2ETesting\E2ETestOptions.cs (1)
26.Where(ama => ama.Key.StartsWith(TestingOptionsPrefix, StringComparison.Ordinal))
src\Shared\E2ETesting\WebDriverExtensions.cs (1)
23var logs = log.Where(entry => entry.Level >= level && !ShouldIgnore(entry)).ToList();
TestProject.AppHost (1)
tests\testproject\Common\TestResourceNames.cs (1)
40.Where(ename => ename != TestResourceNames.None && resourceNames.HasFlag(ename)));
TestProject.IntegrationServiceA (1)
tests\testproject\Common\TestResourceNames.cs (1)
40.Where(ename => ename != TestResourceNames.None && resourceNames.HasFlag(ename)));
VersioningWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
31.Where(kvp => kvp.Key != "link" && kvp.Key != "link_action" && kvp.Key != "link_controller")
Wasm.Performance.ConsoleHost (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
74expr = expr.Concat(rootNode.Options.Where(o => o.Inherited)); 473var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList(); 489var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList(); 505var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
XmlFileLogger (1)
ObjectModel\Project.cs (1)
93foreach (var orphan in _targetNameToTargetMap.Values.Where(t => t.Id < 0))
xunit.assert (6)
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 (2)
336 .Where(f => f.IsPublic && !f.IsStatic) 342 .Where(p => p.GetMethod != null && p.GetMethod.IsPublic && !p.GetMethod.IsStatic)
Sdk\AssertHelper.cs (2)
141 .Where(f => f.IsPublic && !f.IsStatic) 151 .Where(p =>
xunit.console (13)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (5)
67.Where(lib => lib.RuntimeAssemblyGroups?.Count > 0) 70.Where(tuple => tuple != null) 71.SelectMany(tuple => tuple.Item2.AssetPaths.Where(x => x != null) 84.Where(tuple => tuple != null) 85.SelectMany(tuple => tuple.Item2.AssetPaths.Where(x => x != null)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextJsonReader.cs (5)
360.Where(library => library != null); 394.Where(e => e.Type == DependencyContextStrings.RuntimeAssetType) 402groupRuntimeAssemblies.Where(a => Path.GetFileName(a) != "_._"))); 406.Where(e => e.Type == DependencyContextStrings.NativeAssetType) 414groupNativeLibraries.Where(a => Path.GetFileName(a) != "_._")));
ConsoleRunner.cs (3)
244var switchableReporters = reporters.Where(r => !string.IsNullOrWhiteSpace(r.RunnerSwitch)).ToList(); 290foreach (var assemblyElement in results.Where(result => result != null)) 377var filteredTestCases = discoverySink.TestCases.Where(filters.Filter).ToList();
Xunit.NetCore.Extensions (3)
AssemblyFixtureSupport\XunitTestAssemblyRunnerWithAssemblyFixture.cs (1)
45foreach (var fixtureAttr in fixturesAttrs.Where(a => a.LifetimeScope == AssemblyFixtureAttribute.Scope.Assembly))
AssemblyFixtureSupport\XunitTestClassRunnerWithAssemblyFixture.cs (1)
38foreach (var fixtureAttr in assemblyFixtureAttributes.Where(a => a.LifetimeScope == AssemblyFixtureAttribute.Scope.Class))
AssemblyFixtureSupport\XunitTestMethodRunnerWithAssemblyFixture.cs (1)
42foreach (var fixtureAttr in assemblyFixtureAttributes.Where(a => a.LifetimeScope == AssemblyFixtureAttribute.Scope.Method))