1038 references to Any
AnalyzerRunner (2)
CodeRefactoringRunner.cs (1)
43public bool HasRefactorings => _refactorings.Any(pair => pair.Value.Any());
DiagnosticAnalyzerRunner.cs (1)
38public bool HasAnalyzers => _analyzers.Any(pair => pair.Value.Any());
ApplicationModelWebSite (1)
Conventions\FromHeaderConvention.cs (1)
15if (param.Attributes.Any(p => p.GetType() == typeof(FromHeaderAttribute)))
Aspire.Dashboard (2)
Components\Controls\ResourceDetails.razor.cs (1)
28private bool IsSpecOnlyToggleDisabled => !Resource.Environment.All(i => !i.FromSpec) && !GetResourceProperties(ordered: false).Any(static vm => vm.KnownProperty is null);
Otlp\Storage\TelemetryRepository.cs (1)
354if (!_logSubscriptions.Any(s => s.SubscriptionType == SubscriptionType.Read && (s.ApplicationKey == applicationView.ApplicationKey || s.ApplicationKey == null)))
Aspire.Hosting (3)
ApplicationModel\ResourceExtensions.cs (1)
65return resource.Annotations.Any(a => a is T);
Dcp\ApplicationExecutor.cs (1)
835var isFromSpec = specSource?.Any(e => string.Equals(e.Name, env.Name, StringComparison.Ordinal)) is true or null;
ResourceBuilderExtensions.cs (1)
530if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName)))
Aspire.Hosting.Azure.AppContainers (4)
AzureContainerAppsInfrastructure.cs (4)
350External = g.Any(e => e.IsExternal), 352AnyH2 = g.Any(e => e.Transport is "http2"), 367if (endpointsByTargetPort.Any(g => g.External && !g.IsHttpOnly)) 377if (endpointsByTargetPort.Any(g => !Compatible(g.UniqueSchemes)))
Aspire.Hosting.Dapr (1)
CommandLineBuilder.cs (1)
161bool hasReservedChars = value.Any(c => s_reservedChars.Contains(c)) == true;
Aspire.Hosting.Testing.Tests (1)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
52return app.WaitForTextAsync((log) => logTexts.Any(x => log.Contains(x)), resourceName, cancellationToken);
Aspire.Hosting.Tests (2)
Codespaces\CodespacesUrlRewriterTests.cs (1)
44urlRewriterStopped = logs.Any(l => l.Message.Contains("Not running in Codespaces, skipping URL rewriting."));
Utils\LoggerNotificationExtensions.cs (1)
52return app.WaitForTextAsync((log) => logTexts.Any(x => log.Contains(x)), resourceName, cancellationToken);
Aspire.Oracle.EntityFrameworkCore.Tests (2)
ConformanceTests.cs (2)
178Assert.Contains(exportedActivities, activity => activity.Tags.Any(x => x.Key == "server.address")); 179Assert.Contains(exportedActivities, activity => activity.Tags.Any(x => x.Key == "db.system"));
Aspire.Playground.Tests (1)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
52return app.WaitForTextAsync((log) => logTexts.Any(x => log.Contains(x)), resourceName, cancellationToken);
BoundTreeGenerator (1)
BoundNodeClassWriter.cs (1)
1487if (!isExpression && !allSpecifiableFields.Any(f => symbolIsPotentiallyUpdated(f) || immutableArrayIsPotentiallyUpdated(f)))
BuildBoss (2)
ProjectCheckerUtil.cs (1)
150var builtByThisRepository = _solutionMap.Values.Any(projectData => GetAssemblyName(projectData) == internalsVisibleTo.TargetAssembly);
StructuredLoggerCheckerUtil.cs (1)
37if (doubleWrites.Any(doubleWrite => Path.GetFileName(doubleWrite.Key) != "Microsoft.VisualStudio.Text.Internal.dll"))
BuildValidator (1)
Program.cs (1)
187if (excludes.Any(x => filePath.IndexOf(x, FileNameEqualityComparer.StringComparison) >= 0))
CodeStyleConfigFileGenerator (1)
Program.cs (1)
156Debug.Assert(rule.CustomTags.Any(c => c == s_neverTag || c == s_whenExplicitlyEnabledTag || c == s_recommendedTag || c == s_highlyRecommendedTag),
CookieSample (1)
Program.cs (1)
41if (!context.User.Identities.Any(identity => identity.IsAuthenticated))
CookieSessionSample (1)
Startup.cs (1)
32if (!context.User.Identities.Any(identity => identity.IsAuthenticated))
CSharpSyntaxGenerator (2)
SourceWriter.cs (2)
1689var hasOptional = minimalFactoryfields.Any(f => !IsRequiredFactoryField(nd, f)); 1690var hasAttributeOrModifiersList = nd.Fields.Any(f => IsAttributeOrModifiersList(f));
CustomAuthorizationFailureResponse (2)
Authorization\SampleAuthorizationMiddlewareResultHandler.cs (2)
43if (policyAuthorizationResult.AuthorizationFailure.FailedRequirements.Any(requirement => requirement is SampleRequirement)) 51else if (policyAuthorizationResult.AuthorizationFailure.FailedRequirements.Any(requirement => requirement is SampleWithCustomMessageRequirement))
dotnet-dev-certs (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
148.Any(e => string.Equals(oid, e.Oid?.Value, StringComparison.Ordinal));
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
301return hashes.Any(h => string.Equals(h, certificate.Thumbprint, StringComparison.Ordinal));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
123.Any(c => AreCertificatesEqual(c, certificate));
dotnet-openapi (2)
Commands\AddFileCommand.cs (1)
41if (!ApprovedExtensions.Any(e => sourceFile.EndsWith(e, StringComparison.Ordinal)))
Commands\BaseCommand.cs (1)
166if (items.Any(
dotnet-svcutil-lib (44)
CodeDomFixup\WcfCodeGenerationExtension.cs (2)
65if (binding is NetNamedPipeBinding && _options.Project != null && (!_options.Project.TargetFrameworks.Any(t => t.ToLower().Contains("windows")) 66|| !_options.Project.TargetFrameworks.Any(t => TargetFrameworkHelper.IsSupportedFramework(t, out FrameworkInfo fxInfo) && fxInfo.Version.Major >= 6)))
CommandLineParser.cs (1)
59System.Diagnostics.Debug.Assert(!s_allSwitches.Any(s => s.Equals(this)), $"A switch with name or abbreviation '{name}+{abbreviation}' has already been crated!");
CommandProcessorOptions.cs (4)
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))); 815var loadableReferences = this.References.Where(r => !TargetFrameworkHelper.ServiceModelPackages.Any(s => s.Name == r.Name));
ImportModule.cs (1)
69if (!httpBindingTracker.IsHttpBindingContract(contractDescription) || serviceDescriptor.Endpoints.Any(endpoint => endpoint.Contract == contractDescription))
Metadata\MetadaExchangeResolver.cs (1)
57return _metadataSet != null && _metadataSet.MetadataSections.Any((section) => section.Metadata is XmlSchema || section.Metadata is WsdlNS.ServiceDescription);
Metadata\MetadataDocumentSaver.cs (7)
143var missingRefs = files.Where(file => !this.MetadataFiles.Any(metaFile => MetadataFileNameManager.UriEqual(file.FullName, metaFile.SourceUri))); 168if (!string.IsNullOrEmpty(import.Location) && !this.UnresolvedReferences.Any(r => r.WsdlImport == import)) 190if (!this.UnresolvedReferences.Any(r => r.SchemaExternal == schemaExternal)) 218if (wsdl != null && !this.MetadataFiles.Any(mi => mi.Metadata == wsdl)) 240if (schema != null && !this.MetadataFiles.Any(mi => mi.Metadata == schema) /*&& schema.Items.Count > 0*/) 265if (document != null && !this.MetadataFiles.Any(mi => mi.Metadata == document)) 290var mainWsdlFile = wsdlFiles.Where(w => !importedWsdl.Any(i => MetadataFileNameManager.UriEqual(i, w.FilePath))).FirstOrDefault();
Metadata\MetadataFileNameManager.cs (2)
45if (!_files.Any((f) => StringComparer.OrdinalIgnoreCase.Compare(f, filePath) == 0)) 192return files.Any((f) => UriEqual(f, filePath));
Metadata\ServiceDescriptor.cs (1)
242return this.metadataDocumentLoader.MetadataSections.Select((s) => s.Metadata).OfType<WsdlNS.ServiceDescription>().Any((wsdl) => ContainsHttpBindings(wsdl));
Shared\FrameworkInfo.cs (2)
104(TargetFrameworkHelper.NetStandardToNetCoreVersionMap.Keys.Any((netstdVersion) => netstdVersion == version) || 105TargetFrameworkHelper.NetStandardToNetCoreVersionMap.Values.Any((netcoreVersion) => netcoreVersion == version));
Shared\MSBuildProj.cs (5)
139if (this.TargetFrameworks.Count() > 1 && this.TargetFrameworks.Any(t => TargetFrameworkHelper.IsSupportedFramework(t, out netfxInfo) && !netfxInfo.IsDnx)) 520bool addDependency = !_dependencies.Any(d => 550if (this.TargetFrameworks.Any(t => TargetFrameworkHelper.IsSupportedFramework(t, out netfxInfo) && !netfxInfo.IsDnx)) 977if (!this.GlobalProperties.Any(p => p.Key == "TargetFramework")) 982if (!this.GlobalProperties.Any(p => p.Key == "SdkVersion"))
Shared\Options\ListValueOption.cs (1)
113OptionValueParser.ThrowInvalidValueIf(jToken.Any(i => i.Type != JTokenType.String), jToken, this);
Shared\Options\OptionBase.cs (1)
102this.Aliases.Any(a => StringComparer.OrdinalIgnoreCase.Compare(a, optionId) == 0);
Shared\Options\OptionValueParser.cs (1)
168else if (s_nonTelemetrySensitiveOptionIds.Any(id => option.HasSameId(id)))
Shared\ProjectDependency.cs (8)
108if (s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(AssemblyName), ext, StringComparison.OrdinalIgnoreCase) == 0)) 115(s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0)); 118if (s_exeExtensions.Any((ext) => String.Compare(Path.GetExtension(packageName), ext, StringComparison.OrdinalIgnoreCase) == 0)) 133fileHasKnownExtension = s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0); 137fileHasKnownExtension = s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0); 310if (s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(path), ext, StringComparison.OrdinalIgnoreCase) == 0)) 315else if (s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(path), ext, StringComparison.OrdinalIgnoreCase) == 0)) 438if (dependency.IsFramework || TargetFrameworkHelper.ServiceModelPackages.Any(s => s.Name == dependency.Name))
Shared\ProjectPropertyResolver.cs (1)
246if (string.IsNullOrWhiteSpace(propertyName) || propertyName.Any(c => chars.Contains(c) || !char.IsLetterOrDigit(c)))
Shared\Utilities\PathHelper.cs (2)
43.Any(p => folders.Any(f => p.Equals(f, RuntimeEnvironmentHelper.FileStringComparison)));
Shared\Utilities\RuntimeEnvironmentHelper.cs (2)
88.Any(v => v != null && packageFeed.Equals(v, RuntimeEnvironmentHelper.FileStringComparison)); 95while (pkgSourcesNode.Elements("add").Any(e => StringComparer.OrdinalIgnoreCase.Compare(e.Attribute("key").Value, feedName) == 0))
Tool.cs (2)
281if (dep.Name.Contains("NetNamedPipe") && !project.TargetFrameworks.Any(t => t.ToLower().Contains("windows"))) 289if (project.TargetFrameworks.Count() > 1 && project.TargetFrameworks.Any(t => TargetFrameworkHelper.IsSupportedFramework(t, out FrameworkInfo fxInfo) && !fxInfo.IsDnx))
dotnet-svcutil-lib.Tests (2)
TestInit.cs (2)
475fileLines1.RemoveAll(l => exceptLines.Any(ex => l.Contains(ex))); 476fileLines2.RemoveAll(l => exceptLines.Any(ex => l.Contains(ex)));
dotnet-user-jwts (1)
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
dotnet-user-secrets (1)
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
GetDocument.Insider (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-alpha.1.24572.1\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
166if (!args.Any(arg => IsApplicationNameArg(arg)) && assembly.GetName().Name is string assemblyName)
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
89.Any(n => "hostingModel".Equals(n.Attribute("name")?.Value, StringComparison.Ordinal));
IIS.LongTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
89.Any(n => "hostingModel".Equals(n.Attribute("name")?.Value, StringComparison.Ordinal));
IIS.NewHandler.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
89.Any(n => "hostingModel".Equals(n.Attribute("name")?.Value, StringComparison.Ordinal));
IIS.NewShim.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
89.Any(n => "hostingModel".Equals(n.Attribute("name")?.Value, StringComparison.Ordinal));
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
89.Any(n => "hostingModel".Equals(n.Attribute("name")?.Value, StringComparison.Ordinal));
illink (3)
installer.tasks (2)
StaticFileRegeneration\TpnSectionHeader.cs (2)
104if (nameLines.Any(IsSeparatorLine)) 106if (nameLines.Take(nameLines.Length - 1).Any(IsSeparatorLine))
Interop.FunctionalTests (6)
Http3\Http3RequestTests.cs (6)
349return logs.Any(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Transport.Quic" && 1611var hasWriteLog = TestSink.Writes.Any( 1616var hasReadLog = TestSink.Writes.Any( 1795return logs.Any(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Http3" && 2064return logs.Any(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Http3" && 2094return logs.Any(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Http3" &&
InteropWebsite (1)
TestServiceImpl.cs (1)
45await EnsureEchoMetadataAsync(context, request.ResponseParameters.Any(rp => rp.Compressed?.Value ?? false));
Microsoft.Analyzers.Extra (6)
AsyncCallInsideUsingBlockAnalyzer.cs (5)
84.Any(operation => 158.Any(operation => ReferencesSymbol(operation, taskSymbol))) 166.Any(TaskWaitInvoked)) 174.Any(TaskResultInvoked)) 214.Any(operation => ReferencesSymbol(operation, symbol)))
AsyncMethodWithoutCancellation.cs (1)
145.Any(implementation => SymbolEqualityComparer.Default.Equals(implementation, method)))
Microsoft.Arcade.Test.Common (2)
AssertEx.cs (2)
265var none = !actual.Any(predicate); 277var any = actual.Any(predicate);
Microsoft.AspNetCore.Analyzers (1)
CompilationFeatureDetector.cs (1)
48.Any(op => StartupFacts.IsSignalRConfigureMethodGesture(op.TargetMethod)))
Microsoft.AspNetCore.App.Analyzers (5)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
166.Any(operation => UsesAuthorizationOptionsSpecificGetters(operation, authorizationOptionsTypes)
Infrastructure\RoutePattern\RoutePatternParser.cs (1)
275if (!routeParameters.Any(p => string.Equals(p.Name, name, StringComparison.OrdinalIgnoreCase)))
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (1)
193if (parentExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Shared\RoslynUtils\ParsabilityHelper.cs (2)
78if (tryParseMethods.Any(m => IsTryParseWithFormat(m, wellKnownTypes))) 83if (tryParseMethods.Any(IsTryParse))
Microsoft.AspNetCore.App.Analyzers.Test (1)
TestDiagnosticAnalyzer.cs (1)
157if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))
Microsoft.AspNetCore.App.UnitTests (3)
PackageTests.cs (2)
82if (helixTestRunnerToolPackages.Any(s => packageDir.Contains(s, StringComparison.OrdinalIgnoreCase))) 123.Where(f => !toolAssembliesToSkip.Any(s => Path.GetFileNameWithoutExtension(f).Contains(s, StringComparison.OrdinalIgnoreCase)));
TargetingPackTests.cs (1)
204var hasRefAssemblyAttribute = assemblyDefinition.GetCustomAttributes().Any(attr =>
Microsoft.AspNetCore.Authentication.Cookies (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
260Func<string, bool> predicate = value => keys.Any(k => value.StartsWith(k, StringComparison.OrdinalIgnoreCase));
Microsoft.AspNetCore.Authentication.Test (2)
CookieTests.cs (1)
1783if (!p.Identities.Any(i => i.AuthenticationType == "xform"))
GoogleTests.cs (1)
1134if (!p.Identities.Any(i => i.AuthenticationType == "xform"))
Microsoft.AspNetCore.Authorization (1)
DenyAnonymousAuthorizationRequirement.cs (1)
27!user.Identities.Any(i => i.IsAuthenticated);
Microsoft.AspNetCore.Authorization.Policy (1)
AuthorizationEndpointConventionBuilderExtensions.cs (1)
140if (!endpointBuilder.Metadata.Any(meta => meta is IAuthorizeData))
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParameterAnalyzer.cs (1)
147.Any(f => f.IsImplicitlyDeclared && SymbolEqualityComparer.Default.Equals(propertySymbol, f.AssociatedSymbol));
Microsoft.AspNetCore.Components.QuickGrid (1)
Infrastructure\AsyncQueryExecutorSupplier.cs (1)
57=> queryableProviderType.GetInterfaces().Any(x => string.Equals(x.FullName, "Microsoft.EntityFrameworkCore.Query.IAsyncQueryProvider", StringComparison.Ordinal)) == true;
Microsoft.AspNetCore.Components.Server.Tests (1)
ComponentEndpointRouteBuilderExtensionsTest.cs (1)
74if (builder.Metadata.Any(md => md is string smd && smd == "initial-md"))
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
DebugProxyLauncher.cs (1)
47if (noProxyEnvVarValues.Any(noProxyValue => noProxyValue.Equals("localhost") || noProxyValue.Equals("127.0.0.1")))
Microsoft.AspNetCore.CookiePolicy.Test (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
260Func<string, bool> predicate = value => keys.Any(k => value.StartsWith(k, StringComparison.OrdinalIgnoreCase));
Microsoft.AspNetCore.Cors (1)
Infrastructure\CorsPolicyExtensions.cs (1)
24.Any(domain => UriHelpers.IsSubdomainOf(originUri, domain));
Microsoft.AspNetCore.DataProtection (2)
Internal\ContainerUtils.cs (1)
106return Enumerable.Reverse(lines).Any(l => l.EndsWith("name=openrc:/docker", StringComparison.Ordinal));
XmlEncryption\XmlEncryptionExtensions.cs (1)
209return element.DescendantsAndSelf().Any(DoesSingleElementRequireEncryption);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
148.Any(e => string.Equals(oid, e.Oid?.Value, StringComparison.Ordinal));
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
301return hashes.Any(h => string.Equals(h, certificate.Thumbprint, StringComparison.Ordinal));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
123.Any(c => AreCertificatesEqual(c, certificate));
Microsoft.AspNetCore.Diagnostics (1)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
206if (acceptHeader == null || !acceptHeader.Any(h => h.IsSubsetOf(_textHtmlMediaType)))
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
DatabaseDeveloperPageExceptionFilter.cs (1)
77if (contextDetails.Any(c => c.PendingModelChanges || c.PendingMigrations.Any()))
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\XmlComments\GrpcXmlCommentsDocumentFilter.cs (1)
31.Where(actionDesc => actionDesc != null && (actionDesc.EndpointMetadata?.Any(m => m is GrpcMethodMetadata) ?? false))
Microsoft.AspNetCore.HeaderParsing (1)
HeaderParsingServiceCollectionExtensions.cs (1)
26if (!Throw.IfNull(services).Any(x => x.ServiceType == typeof(HeaderParsingFeature.PoolHelper)))
Microsoft.AspNetCore.Hosting (1)
Internal\ConfigureServicesBuilder.cs (1)
40parameters.Any(p => p.ParameterType != typeof(IServiceCollection)))
Microsoft.AspNetCore.Http.Extensions (2)
RequestDelegateFactory.cs (1)
796else if (parameter.CustomAttributes.Any(a => typeof(IFromServiceMetadata).IsAssignableFrom(a.AttributeType)))
src\Shared\PropertyAsParameterInfo.cs (1)
84if (parameters[i].CustomAttributes.Any(a => a.AttributeType == typeof(AsParametersAttribute)))
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
src\Shared\RoslynUtils\ParsabilityHelper.cs (2)
78if (tryParseMethods.Any(m => IsTryParseWithFormat(m, wellKnownTypes))) 83if (tryParseMethods.Any(IsTryParse))
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (1)
288var hasFormFiles = endpoint.Parameters.Any(p => p.IsFormFile);
Microsoft.AspNetCore.Identity (1)
SignInManager.cs (1)
125principal.Identities.Any(i => i.AuthenticationType == AuthenticationScheme);
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
17&& type.DeclaredConstructors.Any(c => c.IsPublic || c.IsFamily || c.IsFamilyOrAssembly)
Microsoft.AspNetCore.Identity.FunctionalTests (2)
Infrastructure\ServerFactory.cs (2)
130if (partsToRemove.Any(p => string.Equals( 145if (!manager.ApplicationParts.Any(p => p.GetType() == part.GetType() &&
Microsoft.AspNetCore.Identity.InMemory.Test (2)
InMemoryStore.cs (1)
53bool result = roleObject != null && user.Roles.Any(ur => ur.RoleId == roleObject.Id);
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
17&& type.DeclaredConstructors.Any(c => c.IsPublic || c.IsFamily || c.IsFamilyOrAssembly)
Microsoft.AspNetCore.Identity.Test (7)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
17&& type.DeclaredConstructors.Any(c => c.IsPublic || c.IsFamily || c.IsFamilyOrAssembly)
UserClaimsPrincipalFactoryTest.cs (6)
99Assert.Equal(supportsUserEmail, claims.Any(c => c.Type == manager.Options.ClaimsIdentity.EmailClaimType && c.Value == user.Email)); 100Assert.Equal(supportRoles, claims.Any(c => c.Type == manager.Options.ClaimsIdentity.RoleClaimType && c.Value == "Admin")); 101Assert.Equal(supportRoles, claims.Any(c => c.Type == manager.Options.ClaimsIdentity.RoleClaimType && c.Value == "Local")); 104Assert.Equal(supportClaims, claims.Any(c => c.Type == cl.Type && c.Value == cl.Value)); 108Assert.Equal(supportRoleClaims, claims.Any(c => c.Type == cl.Type && c.Value == cl.Value)); 112Assert.Equal(supportRoleClaims, claims.Any(c => c.Type == cl.Type && c.Value == cl.Value));
Microsoft.AspNetCore.InternalTesting (3)
xunit\DockerOnlyAttribute.cs (1)
34return Enumerable.Reverse(lines).Any(l => l.EndsWith("name=openrc:/docker", StringComparison.Ordinal));
xunit\EnvironmentVariableSkipConditionAttribute.cs (1)
56var hasMatched = _values.Any(value => string.Equals(value, _currentValue, StringComparison.OrdinalIgnoreCase));
xunit\SkipOnAlpineAttribute.cs (1)
31File.ReadAllLines("/etc/os-release").Any(line =>
Microsoft.AspNetCore.Mvc (2)
MvcServiceCollectionExtensions.cs (2)
326if (!partManager.ApplicationParts.OfType<AssemblyPart>().Any(p => p.Assembly == mvcTagHelpersAssembly)) 332if (!partManager.ApplicationParts.OfType<AssemblyPart>().Any(p => p.Assembly == mvcRazorAssembly))
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\ModelMetadata.cs (1)
145if (!boundParameters.Any(p =>
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
89if (!declaredResponseMetadata.Any(m => m.IsDefault && SymbolEqualityComparer.Default.Equals(m.AttributeSource, context.Method)))
Microsoft.AspNetCore.Mvc.ApiExplorer (5)
EndpointMetadataApiDescriptionProvider.cs (4)
66var disableInferredBody = httpMethodMetadata.HttpMethods.Any(ShouldDisableInferredBody); 277else if (parameter.ParameterInfo.CustomAttributes.Any(a => typeof(IFromServiceMetadata).IsAssignableFrom(a.AttributeType) || typeof(FromKeyedServicesAttribute) == a.AttributeType) || 338producesResponseMetadata.Any(metadata => typeof(IResult).IsAssignableFrom(metadata.Type))) 378if (!supportedResponseTypes.Any(existingResponseType => existingResponseType.StatusCode == apiResponseType.StatusCode))
src\Shared\PropertyAsParameterInfo.cs (1)
84if (parameters[i].CustomAttributes.Any(a => a.AttributeType == typeof(AsParametersAttribute)))
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1538var shouldDisableInferredBodyForMethod = httpMethods is null || httpMethods.Any(method =>
Microsoft.AspNetCore.Mvc.Core (4)
ConsumesAttribute.cs (3)
168var isActionWithoutConsumeConstraintPresent = context.Candidates.Any( 170!candidate.Constraints.Any(constraint => constraint is IConsumesActionConstraint)); 211candidate.Constraints.Any(constraint => constraint is IConsumesActionConstraint &&
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
260Func<string, bool> predicate = value => keys.Any(k => value.StartsWith(k, StringComparison.OrdinalIgnoreCase));
Microsoft.AspNetCore.Mvc.Core.Test (3)
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)));
Microsoft.AspNetCore.Mvc.Razor (1)
RazorView.cs (1)
222renderedLayouts.Any(l => string.Equals(l.Path, layoutPage.Path, StringComparison.Ordinal)))
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (4)
ChecksumValidator.cs (1)
23return checksums.Any(c => string.Equals(item.Identifier, c.Identifier, StringComparison.OrdinalIgnoreCase));
CompilationFailedExceptionFactory.cs (1)
74if (group.Any(g =>
RazorProjectPageRouteModelProvider.cs (2)
56if (context.RouteModels.Any(m => string.Equals(relativePath, m.RelativePath, StringComparison.OrdinalIgnoreCase))) 85if (context.RouteModels.Any(m => string.Equals(relativePath, m.RelativePath, StringComparison.OrdinalIgnoreCase)))
Microsoft.AspNetCore.Mvc.TagHelpers (4)
TagHelperOutputExtensions.cs (4)
151if (SpaceChars.Any(classValue.Contains) || encodedSpaceChars.Any(value => classValue.Contains(value, StringComparison.Ordinal))) 205if (SpaceChars.Any(classValue.Contains) || encodedSpaceChars.Any(value => classValue.Contains(value, StringComparison.Ordinal)))
Microsoft.AspNetCore.Mvc.Testing (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-alpha.1.24572.1\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
166if (!args.Any(arg => IsApplicationNameArg(arg)) && assembly.GetName().Name is string assemblyName)
WebApplicationFactory.cs (1)
345.Where(library => library.Dependencies.Any(d => string.Equals(d.Name, entryPointAssemblyName, StringComparison.Ordinal)));
Microsoft.AspNetCore.OpenApi (4)
Extensions\JsonNodeSchemaExtensions.cs (1)
421&& !polymorphismOptions.DerivedTypes.Any(type => type.DerivedType == context.TypeInfo.Type);
Services\OpenApiDocumentService.cs (1)
447parameterInfoDescriptor.ParameterInfo.GetCustomAttributes(inherit: true).Any(attr => attr is RequiredAttribute);
Services\OpenApiGenerator.cs (1)
423else if (parameter.CustomAttributes.Any(a => typeof(IFromServiceMetadata).IsAssignableFrom(a.AttributeType) || typeof(FromKeyedServicesAttribute) == a.AttributeType) ||
src\Shared\PropertyAsParameterInfo.cs (1)
84if (parameters[i].CustomAttributes.Any(a => a.AttributeType == typeof(AsParametersAttribute)))
Microsoft.AspNetCore.Routing (5)
Matching\AcceptsMatcherPolicy.cs (1)
44return endpoints.Any(e => e.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes.Count > 0);
Matching\HostMatcherPolicy.cs (1)
48return endpoints.Any(e =>
Matching\ILEmitTrieFactory.cs (3)
58entries.Any(e => e.text.Length >= 4); 455var disableBinarySearch = groups.Any(group => groups.Any(otherGroup => otherGroup.Key != group.Key && (otherGroup.Key | 0x20) == (group.Key | 0x20)));
Microsoft.AspNetCore.Routing.Tests (11)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (4)
1021if (b.Metadata.Any(md => md is string smd && smd == "added-from-endpoint")) 1045if (b.Metadata.Any(md => md is string smd && smd == "added-from-endpoint-1") 1046&& b.Metadata.Any(md => md is string smd && smd == "added-from-endpoint-2")) 1053if (b.Metadata.Any(md => md is string smd && smd == "added-from-inner-group"))
Builder\RoutingEndpointConventionBuilderExtensionsTest.cs (3)
182if (inner.Metadata.Any(md => md is string smd && smd == "test-metadata")) 206if (inner.Metadata.Any(md => md is string smd && smd == "test-metadata")) 213if (inner.Metadata.Any(md => md is string smd && smd == "inner-metadata"))
Matching\DfaMatcherBuilderTest.cs (3)
3593return endpoints.Any(e => e.Metadata.GetMetadata<TestMetadata1>() != null); 3635return endpoints.Any(e => e.Metadata.GetMetadata<TestMetadata2>() != null); 3661return endpoints.Any(e => e.Metadata.GetMetadata<TestMetadata1>() != null);
Template\TemplateParserTests.cs (1)
892if (!y.InlineConstraints.Any<InlineConstraint>(
Microsoft.AspNetCore.Server.IntegrationTesting (1)
xunit\IISExpressAncmSchema.cs (1)
46.Any(n => "hostingModel".Equals(n.Attribute("name")?.Value, StringComparison.Ordinal));
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (1)
IISDeployer.cs (1)
422appPool.WorkerProcesses.Any(wp =>
Microsoft.AspNetCore.Server.Kestrel.Core (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
148.Any(e => string.Equals(oid, e.Oid?.Value, StringComparison.Ordinal));
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
301return hashes.Any(h => string.Equals(h, certificate.Thumbprint, StringComparison.Ordinal));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
123.Any(c => AreCertificatesEqual(c, certificate));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
SkipOnMarinerAttribute.cs (1)
26File.ReadAllLines("/etc/os-release").Any(line =>
Microsoft.AspNetCore.SignalR.Client.Tests (10)
HubServerProxyGeneratorTests.cs (9)
131It.Is<object[]>(y => ((object[])y).Any(z => (int)z == 20)), 155It.Is<object[]>(y => ((object[])y).Any(z => (List<int>)z == arg)), 224It.Is<object[]>(y => ((object[])y).Any(z => (ChannelReader<int>)z == channelReader)), 230It.Is<object[]>(y => ((object[])y).Any(z => (IAsyncEnumerable<int>)z == asyncEnumerable)), 237It.Is<object[]>(y => ((object[])y).Any(z => (ChannelReader<int>)z == channelReader)), 271It.Is<object[]>(y => ((object[])y).Any(z => z is ChannelReader<float>)), 278It.Is<object[]>(y => ((object[])y).Any(z => z is ChannelReader<float>)), 284It.Is<object[]>(y => ((object[])y).Any(z => z is IAsyncEnumerable<float>)), 290It.Is<object[]>(y => ((object[])y).Any(z => z is IAsyncEnumerable<float>)),
ResponseUtils.cs (1)
55return request.Method == HttpMethod.Get && request.Headers.Accept.Any(h => h.MediaType == "text/event-stream");
Microsoft.AspNetCore.TestHost (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-alpha.1.24572.1\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
166if (!args.Any(arg => IsApplicationNameArg(arg)) && assembly.GetName().Name is string assemblyName)
Microsoft.AspNetCore.Tests (3)
WebApplicationTests.cs (2)
1637args.Payload.OfType<string>().Any(p => p.Contains(guid))); 1657args.Payload.OfType<string>().Any(p => p.Contains(guid)));
WebHostTests.cs (1)
111args.Payload.OfType<string>().Any(p => p.Contains("Request starting")));
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Autobahn\AutobahnCaseResult.cs (1)
28return behaviors.Any(b => string.Equals(b, ActualBehavior, StringComparison.Ordinal));
Microsoft.Build (38)
BackEnd\BuildManager\BuildManager.cs (4)
2631if (newNodes?.Count != response.NumberOfNodesToCreate || newNodes.Any(n => n == null)) 2996if (!result.Any(l => l.ForwardingLoggerDescription.Name.Contains(engineAssemblyName))) 3003if (result.Any(l => 3177if (inputCacheFiles.Any(f => !File.Exists(f)))
BackEnd\Components\Logging\LoggingService.cs (5)
526get => _includeEvaluationMetaprojects ??= _eventSinkDictionary.Values.OfType<EventSourceSink>().Any(sink => sink.IncludeEvaluationMetaprojects); 535get => _includeEvaluationProfile ??= _eventSinkDictionary.Values.OfType<EventSourceSink>().Any(sink => sink.IncludeEvaluationProfiles); 544get => _includeTaskInputs ??= _eventSinkDictionary.Values.OfType<EventSourceSink>().Any(sink => sink.IncludeTaskInputs); 583sinks.Any(sink => sink.IncludeEvaluationPropertiesAndItems); 587sinks.Any(sink => !sink.IncludeEvaluationPropertiesAndItems);
BackEnd\Components\SdkResolution\SdkResolverService.cs (2)
326if (result?.Warnings?.Any(s => s is null) == true || result?.Errors?.Any(s => s is null) == true)
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (1)
206instance.SupportedRules.Any(r => r.DefaultConfiguration.IsEnabled == true));
BuildEnvironmentHelper.cs (1)
423return processList.Any(s =>
Construction\ProjectRootElement.cs (1)
1004if (itemGroup.Items.Any(item => MSBuildNameIgnoreCaseComparer.Default.Equals(itemType, item.ItemType)))
Construction\Solution\ProjectInSolution.cs (1)
556return mainProjectElement.Attributes.OfType<XmlAttribute>().Any(a =>
Definition\Project.cs (1)
3365if (_data.ImportClosure.Any(import => ReferenceEquals(import.ImportedProject, xmlRootElement)))
Evaluation\Expander.cs (4)
2016if (expressionCapture.Captures?.Any(capture => string.Equals(capture.FunctionName, "Count", StringComparison.OrdinalIgnoreCase)) != true) 2019if (expressionCapture.Captures?.Any(capture => string.Equals(capture.FunctionName, "AnyHaveMetadataValue", StringComparison.OrdinalIgnoreCase)) != true) 3600if (args.Any(a => "out _".Equals(a))) 5635internal static bool IsKnownOverloadMethodName(string methodName) => s_knownOverloadName.Any(name => string.Equals(name, methodName, StringComparison.OrdinalIgnoreCase));
Evaluation\ItemSpec.cs (1)
88return ReferencedItems.Any(v => v.ItemAsValueFragment.IsMatch(itemToMatch));
Evaluation\LazyItemEvaluator.cs (1)
380if (MSBuildConstants.CharactersForExpansion.Any(frag.TextFragment.Contains))
Evaluation\LazyItemEvaluator.UpdateOperation.cs (2)
123var isMatch = nonItemReferenceFragments.Any(f => f.IsMatch(item.EvaluatedInclude)); 172return itemSpec.Fragments.Any(f => f is ItemSpec<P, I>.ItemExpressionFragment);
ExceptionHandling.cs (1)
129if (aggregateException.InnerExceptions.Any(innerException => IsCriticalException(innerException)))
FileMatcher.cs (1)
209return s_propertyAndItemReferences.Any(filespec.Contains);
FileUtilities.cs (1)
1482if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Graph\GraphBuilder.cs (1)
249if (entryPoints.Count == 0 || !entryPoints.Any(e => FileUtilities.IsSolutionFilename(e.ProjectFile)))
Graph\ProjectGraph.cs (1)
793if (targetNames.Any(targetName => string.IsNullOrWhiteSpace(targetName)))
Instance\HostServices.cs (1)
429return _hostObjects.Any(h => h.Value.IsTaskHost);
Instance\ImmutableProjectCollections\ImmutableItemDictionary.cs (2)
162public bool HasEmptyMarker(string itemType) => _itemsByType.Values.Any(list => list.Count == 0); 204return _list.Any(
Instance\ProjectInstance.cs (1)
2706loggers.Any(logger => logger.Verbosity == LoggerVerbosity.Diagnostic) ||
LoadedType.cs (2)
53if (CustomAttributeData.GetCustomAttributes(t).Any(attr => attr.AttributeType.Name.Equals(nameof(LoadInSeparateAppDomainAttribute)))) 58if (CustomAttributeData.GetCustomAttributes(t).Any(attr => attr.AttributeType.Name.Equals(nameof(RunInSTAAttribute))))
Utilities\EngineFileUtilities.cs (2)
564return _regexMatchCache.Value.GetOrAdd(fileSpec, file => s_lazyWildCardExpansionRegexes.Any(regex => regex.IsMatch(fileSpec))); 581return file => matchers.Any(m => m.Value.IsMatch(file));
Utilities\NuGetFrameworkWrapper.cs (1)
126if (filterFrameworks.Any(r =>
Microsoft.Build.Engine.OM.UnitTests (3)
BuildEnvironmentHelper.cs (1)
423return processList.Any(s =>
ExceptionHandling.cs (1)
129if (aggregateException.InnerExceptions.Any(innerException => IsCriticalException(innerException)))
FileUtilities.cs (1)
1482if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Microsoft.Build.Engine.UnitTests (3)
Evaluation\Evaluator_Tests.cs (1)
1011bool circularImportsAreRecorded = project.ImportsIncludingDuplicates.Any(resolvedImport => string.Equals(resolvedImport.ImportingElement.ContainingProject.FullPath, importPath2, StringComparison.OrdinalIgnoreCase));
FileUtilities_Tests.cs (1)
270if (!FileUtilities.GetIsFileSystemCaseSensitive() || allowedExtensions.Any(extension => fileName.Contains(extension)))
Instance\ProjectInstance_Internal_Tests.cs (1)
1031if (!pc.Toolsets.Any(t => String.Equals(t.ToolsVersion, toolsVersion, StringComparison.OrdinalIgnoreCase)))
Microsoft.Build.Framework (2)
FileClassifier.cs (1)
153if (msBuildProcess.Any(s =>
Logging\AnsiDetector.cs (1)
45if (terminalsRegexes.Any(regex => regex.IsMatch(termType)))
Microsoft.Build.Tasks.Core (8)
AssemblyDependency\ResolveAssemblyReference.cs (1)
1114bool logWarning = idealAssemblyRemappingsIdentities.Any(i => i.assemblyName.FullName.Equals(fusionName) && i.reference.GetConflictVictims().Count == 0);
BuildEnvironmentHelper.cs (1)
423return processList.Any(s =>
ExceptionHandling.cs (1)
129if (aggregateException.InnerExceptions.Any(innerException => IsCriticalException(innerException)))
FileMatcher.cs (1)
209return s_propertyAndItemReferences.Any(filespec.Contains);
FileUtilities.cs (1)
1482if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
GetSDKReferenceFiles.cs (1)
418if (_resolvedReferences.Any(x => String.Equals(x.AssemblyLocation, reference.AssemblyLocation, StringComparison.OrdinalIgnoreCase)))
RedistList.cs (1)
758if (!mapping.Any(x => x.From.Equals(pair.From)))
Unzip.cs (1)
294result |= _excludePatterns.Any(pattern => FileMatcher.IsMatch(FileMatcher.Normalize(zipArchiveEntry.FullName), pattern));
Microsoft.Build.UnitTests.Shared (1)
EnvironmentProvider.cs (1)
65.Where(p => !Path.GetInvalidPathChars().Any(p.Contains))
Microsoft.Build.Utilities.Core (4)
BuildEnvironmentHelper.cs (1)
423return processList.Any(s =>
ExceptionHandling.cs (1)
129if (aggregateException.InnerExceptions.Any(innerException => IsCriticalException(innerException)))
FileMatcher.cs (1)
209return s_propertyAndItemReferences.Any(filespec.Contains);
FileUtilities.cs (1)
1482if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Microsoft.Cci.Extensions (46)
Extensions\CSharp\CSharpCciExtensions.cs (13)
286return property.Accessors.Any(m => m.ResolvedMethod.IsInterfaceImplementation()); 290return evnt.Accessors.Any(m => m.ResolvedMethod.IsInterfaceImplementation()); 309return property.Accessors.Any(m => m.ResolvedMethod.IsAbstract); 313return evnt.Accessors.Any(m => m.ResolvedMethod.IsAbstract); 326return property.Accessors.Any(m => m.ResolvedMethod.IsVirtual); 330return evnt.Accessors.Any(m => m.ResolvedMethod.IsVirtual); 343return property.Accessors.Any(m => m.ResolvedMethod.IsNewSlot); 347return evnt.Accessors.Any(m => m.ResolvedMethod.IsNewSlot); 360return property.Accessors.Any(m => m.ResolvedMethod.IsSealed); 364return evnt.Accessors.Any(m => m.ResolvedMethod.IsSealed); 377return property.Accessors.Any(m => m.ResolvedMethod.IsOverride()); 381return evnt.Accessors.Any(m => m.ResolvedMethod.IsOverride()); 703.Any(m =>
Extensions\TypeExtensions.cs (2)
445return assembly.AssemblyAttributes.Any(a => a.Type.FullName() == "System.Runtime.CompilerServices.ReferenceAssemblyAttribute"); 498if (assembly.GetAllTypes().Any(t => t.Name.Value != "<Module>"))
Filters\AttributeMarkedFilter.cs (1)
41return !definition.Attributes.Any(a => String.Equals(a.Type.FullName(), _attributeName, StringComparison.Ordinal));
Filters\CommonTypesMappingDifferenceFilter.cs (2)
27return _baseFilter.Include(assembly) && assembly.Namespaces.Any(Include); 32return _baseFilter.Include(ns) && ns.Types.Any(Include);
Filters\DocIdExcludeListFilter.cs (3)
36if (!ns.GetTypes(IncludeForwardedTypes).Any(Include)) 64if (method != null && method.Parameters.Any(param => !IncludeTypeReference(param.Type))) 77if (genericType != null && genericType.GenericArguments.Any(genArg => _docIds.Contains(genArg.DocId())))
Filters\DocIdIncludeListFilter.cs (2)
34if (!ns.GetTypes(IncludeForwardedTypes).Any(Include)) 43if (AlwaysIncludeNonEmptyTypes && type.Members.Any(Include))
Filters\ExcludeCompilerGeneratedCciFilter.cs (2)
29return ns.GetTypes(includeForwards: true).Any(Include); 79return !definition.Attributes.Any(
Filters\ExcludeOverridesFilter.cs (2)
45return property.Accessors.Any(a => Include((IMethodDefinition) a.ResolvedMethod)); 50return evnt.Accessors.Any(a => Include(a.ResolvedMethod));
Filters\InternalsAndPublicCciFilter.cs (1)
41return ns.GetTypes(IncludeForwardedTypes).Any(Include);
Filters\MappingDifferenceFilter.cs (4)
27return assembly.Namespaces.Any(Include); 35return ns.Types.Any(Include); 52return type.Members.Any(Include) || type.NestedTypes.Any(Include);
Filters\NotImplementedFilter.cs (2)
47return prop.Accessors.Any(a => Include(a.ResolvedMethod)); 52return evnt.Accessors.Any(a => Include(a.ResolvedMethod));
Filters\PublicAndProtectedFilter.cs (1)
19return ns.Members.OfType<ITypeDefinition>().Any(Include);
Filters\PublicOnlyCciFilter.cs (1)
30return ns.GetTypes(this.IncludeForwardedTypes).Any(Include);
Traversers\SimpleTypeMemberTraverser.cs (1)
39namespaces = namespaces.Where(ns => ns.GetTypes(this.IncludeForwardedTypes).Any(_filter.Include));
Writers\CSharp\CSDeclarationWriter.Attributes.cs (1)
20if (!securityAttributes.SelectMany(s => s.Attributes).Any(IncludeAttribute))
Writers\CSharp\CSDeclarationWriter.Enums.cs (1)
38if (resolvedType.Attributes.Any(a => a.Type.GetTypeName() == "System.FlagsAttribute"))
Writers\CSharp\CSDeclarationWriter.Methods.cs (4)
352if (method.Parameters.Any(p => p.IsOut)) 376IntersectionFilter intersection => intersection.Filters.Any( 445m => m.IsConstructor && _filter.Include(m) && !m.Attributes.Any(a => a.IsObsoleteWithUsageTreatedAsCompilationError())); 447if (constructors.Any(c => c.ParameterCount == 0))
Writers\CSharp\CSharpWriter.cs (3)
138types = types.Where(t => ConditionalTypeLists.Any(c => c.Filter.Include(t) == !firstPass)); 238bool hasRefPrivateField = excludedFields.Any(f => f.Type.IsOrContainsReferenceType()); 246bool hasNonEmptyStructPrivateField = excludedFields.Any(f => f.Type.IsOrContainsNonEmptyStruct());
Microsoft.CodeAnalysis (8)
Binding\UseSiteInfo.cs (1)
62Debug.Assert(secondaryDependencies?.IsEmpty != false || !secondaryDependencies.Any(dependency => dependency == dependency.CorLibrary));
CodeGen\BasicBlock.cs (1)
462Debug.Assert(!builder._labelInfos.Values.Any(li => li.bb == toRemove),
CommandLine\SarifV1ErrorLogger.cs (1)
110additionalLocations.Any(l => HasPath(l)))
CommandLine\SarifV2ErrorLogger.cs (1)
149additionalLocations.Any(l => HasPath(l)))
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1349return root.DescendantTokens().Any(static token => string.Equals(token.ValueText, "GeneratedCode", StringComparison.Ordinal) ||
DiagnosticAnalyzer\DiagnosticQueue.cs (1)
174if (lazyDiagnosticsMap != null && lazyDiagnosticsMap.Any(kvp => kvp.Value.TryDequeue(out diag)))
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
608if (typeArguments.Any(a => !a.IsBound))
InternalUtilities\EnumerableExtensions.cs (1)
661return sequence.Any(predicate);
Microsoft.CodeAnalysis.CodeStyle (27)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
43Debug.Assert(!supportedDiagnostics.Any(descriptor => descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer);
src\Analyzers\Core\Analyzers\AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (2)
93if (descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) 132if (descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary))
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (1)
37s_diagnosticIdToLanguageSpecificOptionsMap.Values.Any(map => map.ContainsKey(diagnosticId));
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
115?.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
52if (node.ContainsDiagnostics && node.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
130if (root.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
597if (tree.GetDiagnostics(cancellationToken).Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
81if (syntax.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
118if (context.Operation.Syntax.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
572NonConstructorLocations(writeLocations1).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 585NonConstructorLocations(writeLocations2).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration)))
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
608if (typeArguments.Any(a => !a.IsBound))
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
661return sequence.Any(predicate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (7)
655return getAwaiters.Any(VerifyGetAwaiter); 671if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 689return methods.Any(m => m.Name == WellKnownMemberNames.GetResult && !m.Parameters.Any()); 710if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 716if (!members.OfType<IMethodSymbol>().Any(x => 750if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 759if (!members.OfType<IMethodSymbol>().Any(x => x.Name == WellKnownMemberNames.MoveNextAsyncMethodName))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
61return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
411.Any(m => m.Parameters.Any());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
290if (list.Any(o => o != null && o.TextSpan.Contains(position)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
95if (operations.Any(o => o.TextSpan.Contains(span)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
247=> list.Any(syntaxFacts.IsPreprocessorDirective); 862=> node.ChildNodes().Any(c => c.RawKind == syntaxFacts.SyntaxKinds.GlobalStatement);
Microsoft.CodeAnalysis.CodeStyle.Fixes (10)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
148.Any(nameAttributes => nameAttributes.Select(GetValueFromNameAttribute).Contains(name));
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
184return NameGenerator.EnsureUniqueness(parameterNames, isFixed, canUse: s => !reservedNames.Any(n => comparer.Equals(s, n)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
117return availableIndices != null && availableIndices.Any(b => b);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (1)
175=> arg.removeAttributeTypes.Any(attr => attr.Equals(a.AttributeClass)) ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (1)
70=> arg.attributesToRemove.Any(attr => attr.Equals(a.AttributeClass)) ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (5)
48private bool HasAliases(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsAlias); 49private bool HasUsings(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsSimpleUsing); 50private bool HasStaticUsings(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsStaticUsing); 79if (GetUsingsAndAliases(node).Any(u => IsEquivalentImport(u, import))) 84if (GetExterns(node).Any(u => IsEquivalentImport(u, import)))
Microsoft.CodeAnalysis.CSharp (11)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (2)
2975return types?.Any(t => isFunctionType(t, out _)) == true; 2980return types?.Any(t => !isFunctionType(t, out _)) == true;
CommandLine\CSharpCompiler.cs (1)
268return args.Any(arg => new[] { "/noconfig", "-noconfig" }.Contains(arg.ToLowerInvariant()));
Compilation\CSharpCompilation.cs (1)
787if (root.DescendantNodes(n => n is GlobalStatementSyntax || n is StatementSyntax || n is CompilationUnitSyntax).Any(n => n.IsKind(SyntaxKind.ReturnStatement)))
Compilation\SyntaxAndDeclarationManager.cs (1)
211Debug.Assert(!directive.IsActive || tree.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error));
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1055return implParameterAttributeList.Any(attrList => attrList.Attributes.Contains(node));
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4271Debug.Assert(isRecordClass || !members.Any(m => m is PropertySymbol { GetMethod.IsEffectivelyReadOnly: false }));
Syntax\SyntaxNodeRemover.cs (1)
59: base(nodesToRemove.Any(n => n.IsPartOfStructuredTrivia()))
Syntax\SyntaxReplacer.cs (3)
105_nodeSet.Any(n => n.IsPartOfStructuredTrivia()) || 106_tokenSet.Any(t => t.IsPartOfStructuredTrivia()) || 107_triviaSet.Any(t => t.IsPartOfStructuredTrivia());
Microsoft.CodeAnalysis.CSharp.CodeStyle (40)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertNamespaceAnalysis.cs (1)
77if (namespaceDeclaration.Members.Any(static m => m is BaseNamespaceDeclarationSyntax))
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (3)
117if (typeDeclaration.GetLeadingTrivia().Any(t => t.IsDocComment())) 132if (member.Modifiers.Any(m => m.Kind() is SyntaxKind.PublicKeyword or SyntaxKind.ProtectedKeyword or SyntaxKind.InternalKeyword)) 146if (member.GetLeadingTrivia().Any(t => t.IsDocComment()))
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (3)
142if (labels.Any(label => IsDefaultSwitchLabel(label))) 179if (switchStatement.Sections.Any(section => section.Labels.Any(label => IsDefaultSwitchLabel(label))))
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
51if (switchStatement.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
81.Any(field => field is { AssociatedSymbol: null, IsStatic: false, IsReadOnly: true });
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
94return compilationUnit.ChildNodes().Any(
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (2)
72if (arrowExpressionClause.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error)) 105if (nextToken.LeadingTrivia.Any(static t => t.Kind() is
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
86if (nextToken.LeadingTrivia.Any(static t => t.Kind() is
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (2)
85if (colonToken.TrailingTrivia.Any(t => !t.IsWhitespaceOrEndOfLine())) 88if (thisOrBaseKeyword.LeadingTrivia.Any(t => !t.IsWhitespaceOrEndOfLine() && !t.IsSingleOrMultiLineComment()))
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
58.Any(declaringSyntax => IsInPropertyInitialization(declaringSyntax, node) || IsInFieldInitialization(declaringSyntax, node));
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
94if (topMostExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)) 672if (initializer.OpenBraceToken.GetPreviousToken().TrailingTrivia.Any(static x => x.IsSingleOrMultiLineComment())) 918if (arguments.Any(static a => a.NameColon != null))
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
160if (whenTrue.GetLeadingTrivia().Any(static t => t.GetStructure() is ConditionalDirectiveTriviaSyntax))
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (1)
140if (semicolonToken.TrailingTrivia.Any(t => t.IsDirective))
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
99if (localDeclaration.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
56if (expression.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
117property.AccessorList.Accessors.Any(static a => a.ExpressionBody != null || a.Body != null)) 522!syntaxRef.GetSyntax(cancellationToken).AncestorsAndSelf().Any(a => a == assignmentExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
184if (parentExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArrowExpressionClauseSyntaxExtensions.cs (2)
43if (arrowExpression.ArrowToken.TrailingTrivia.Any(t => t.IsSingleOrMultiLineComment())) 46if (arrowExpression.ArrowToken.LeadingTrivia.Any(t => t.IsSingleOrMultiLineComment()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (2)
96if (parsed.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error)) 195expression = firstStatement.GetLeadingTrivia().Any(t => t.IsDirective || t.IsSingleOrMultiLineComment())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
861if (expression.GetLeadingTrivia().Any(t => t.IsDirective)) 881if (expression.GetLeadingTrivia().Any(t => t.IsSingleOrMultiLineComment()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ILocalSymbolExtensions.cs (1)
45return typeParameters.HasValue && typeParameters.Value.Any(typeParameter => typeParameter.Identifier.ValueText == name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (3)
449=> node.DescendantNodes(n => n == node || !n.IsReturnableConstruct()).Any(n => n is YieldStatementSyntax); 603var hasLeadingDirective = node.GetLeadingTrivia().Any(t => SyntaxFacts.IsPreprocessorDirective(t.Kind())); 901var hasTrailingComments = from.GetTrailingTrivia().Any(t => t.IsRegularComment());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
411=> node.Ancestors().Any(n => n.Kind() is
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
137.Any(node => node.IsKind(SyntaxKind.StackAllocArrayCreationExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
35if (!firstUsing.GetLeadingTrivia().Any(t => t.IsEndOfLine())) 48!currentUsing.GetLeadingTrivia().Any(t => t.IsEndOfLine()))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (14)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
162if (accessors.Any(a => a.Body != null || a.ExpressionBody != null) ||
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
103if (deconstruction is PositionalPatternClauseSyntax positionalPatternClause && positionalPatternClause.Subpatterns.Any(p => p.Pattern is not ConstantPatternSyntax))
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
99var seenNamedArgument = currentInvocation.ArgumentList.Arguments.Any(a => a.NameColon != null);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
283if (seenUsings.Any(seenUsingDirective => seenUsingDirective.IsEquivalentTo(usingDirective, topLevel: false)))
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
186if (!removedMembers.Any(kvp => kvp.Value.memberNode == priorMember)) 229if (!properties.Values.Any(v => v == current.Identifier.ValueText))
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
152var constructorContents = typeStructure.Content.Any(n => n is XmlElementSyntax { StartTag.Name.LocalName.ValueText: s_summaryTagName })
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
58if (typeArgumentList.Arguments.Any(a => a.Kind() != SyntaxKind.OmittedTypeArgument))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (2)
163if (root.Usings[i].GetLeadingTrivia().Any(trivia => trivia.IsKind(SyntaxKind.IfDirectiveTrivia))) 168if (root.Usings[i].GetLeadingTrivia().Any(trivia => trivia.IsKind(SyntaxKind.EndIfDirectiveTrivia)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1706=> tuple.Arguments.Any(a => a.NameColon != null);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
101if (reference.GetSyntax().ChildTokens().Any(t => t.IsKind(SyntaxKind.UnsafeKeyword)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
50if (localDeclarationStatement.Declaration.Variables.Any(IsDiscardDeclaration))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1373if (types.Any(t => t is IArrayTypeSymbol))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupSessionManager.cs (1)
146if (change.OldText.Length > 0 || change.NewText.Any(c => c != ' '))
Interactive\CSharpSendToInteractiveSubmissionProvider.cs (1)
33!tree.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (8)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (8)
96Assert.False(ideEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.MethodKind == MethodKind.DelegateInvoke && e.ReturnsVoid)); 97Assert.False(ideEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.MethodKind == MethodKind.DelegateInvoke && !e.ReturnsVoid)); 98Assert.True(ideEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.SymbolKind == SymbolKind.NamedType)); 99Assert.False(ideEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.SymbolKind == SymbolKind.Property)); 109Assert.False(compilerEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.MethodKind == MethodKind.DelegateInvoke && e.ReturnsVoid)); 110Assert.False(compilerEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.MethodKind == MethodKind.DelegateInvoke && !e.ReturnsVoid)); 111Assert.True(compilerEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.SymbolKind == SymbolKind.NamedType)); 112Assert.False(compilerEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.SymbolKind == SymbolKind.Property));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenDeconstructTests.cs (2)
5001Assert.False(nodes.Any(n => n.Kind() == SyntaxKind.SimpleAssignmentExpression)); 5124Assert.True(nodes.Any(n => n.Kind() == SyntaxKind.SimpleAssignmentExpression));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Attributes\AttributeTests_Nullable.cs (1)
195Assert.False(reader.TypeDefinitions.Any(h => reader.StringComparer.Equals(reader.GetTypeDefinition(h).Name, name)));
Semantics\OutVarTests.cs (1)
1279forStatement.Statement.DescendantNodes().OfType<ForStatementSyntax>().Any(f => f.Condition == null))
Microsoft.CodeAnalysis.CSharp.Features (62)
AddImport\CSharpAddImportFeatureService.cs (1)
163node.AncestorsAndSelf().Any(n => n is QueryExpressionSyntax && !(n.Parent is QueryContinuationSyntax));
ChangeSignature\CSharpChangeSignatureService.cs (1)
259return node.AncestorsAndSelf().Any(n => n == nodeContainingOriginal) ? matchingNode : null;
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
229return pragmaWarning.ErrorCodes.Any(n => n.ToString() == id);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
191!supportsNonTrailing && invocation.ArgumentList.Arguments.Any(arg => arg.NameColon != null);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (2)
238if (descendantNodesAndSelf.Any(n => n.Kind() is SyntaxKind.ObjectCreationExpression or SyntaxKind.InvocationExpression)) 300var newLocalDeclaration = variableDeclarator.GetLeadingTrivia().Any(t => t.IsDirective)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
314Debug.Assert(!compilationUnit.Members.Any(m => m is BaseNamespaceDeclarationSyntax)); 372if (namespaceDecl.Name.GetDiagnostics().Any(diag => diag.DefaultSeverity == DiagnosticSeverity.Error))
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
85return declarations.Any(d => d.Body == null && d.Modifiers.Any(SyntaxKind.PartialKeyword));
Completion\KeywordRecommenders\AllowsKeywordRecommender.cs (1)
45.Any(c => c.ClassOrStructKeyword.Kind() == SyntaxKind.ClassKeyword))
Completion\KeywordRecommenders\NewKeywordRecommender.cs (1)
106.Any(c => c.ClassOrStructKeyword.Kind() == SyntaxKind.StructKeyword))
Completion\KeywordRecommenders\RefKeywordRecommender.cs (1)
112.Any(c => c.ClassOrStructKeyword.Kind() == SyntaxKind.ClassKeyword))
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
72if (stringExpression.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (3)
190block.DescendantNodes().OfType<ThrowStatementSyntax>().Any(t => t.Expression is null)) 341if (textTokens.Any(t => !string.IsNullOrWhiteSpace(t.ToString()))) 360=> token.TrailingTrivia.Any(t => t.Kind() == SyntaxKind.SkippedTokensTrivia);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
876var hasDecitionTree = oldNode.Sections.Any(s => s.Labels.Any(l => l is CasePatternSwitchLabelSyntax));
EditAndContinue\SyntaxUtilities.cs (2)
200&& property.AccessorList!.Accessors.Any(e => e.Body == null && e.ExpressionBody == null); 245=> body.DescendantNodesAndSelf(LambdaUtilities.IsNotLambda).Any(n => n is YieldStatementSyntax);
ExtractInterface\CSharpExtractInterfaceService.cs (1)
63return typeDeclaration.Modifiers.Any(m => SyntaxFacts.IsAccessibilityModifier(m.Kind()));
ExtractMethod\CSharpMethodExtractor.cs (1)
178if (!leadingTrivia.Any(t => t.IsKind(SyntaxKind.EndOfLineTrivia)) && !methodDefinition.FindTokenOnLeftOfPosition(methodDefinition.SpanStart).IsKind(SyntaxKind.OpenBraceToken))
ExtractMethod\CSharpSelectionValidator.cs (2)
349if (tokens.Any(t => t.Kind() == SyntaxKind.YieldKeyword)) 468if (returnStatements.Cast<ReturnStatementSyntax>().Any(r => r.Expression != null))
ExtractMethod\Extensions.cs (2)
92return initializer.ArgumentList.Arguments.Any(a => a.Span.Contains(textSpan)); 234=> set.Any(a => node.GetAnnotatedNodesAndTokens(a).Any());
GenerateType\CSharpGenerateTypeService.cs (1)
764.Any(n => n.Equals(includeUsingsOrImports)))
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
386var localFunctions = innermostCommonBlock.DescendantNodes().Where(node => node.IsKind(SyntaxKind.LocalFunctionStatement) && matches.Any(match => match.Span.OverlapsWith(node.Span)));
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (2)
213return block.CloseBraceToken.LeadingTrivia.Any(HasCommentTrivia) 214|| block.OpenBraceToken.TrailingTrivia.Any(HasCommentTrivia);
Organizing\Organizers\MemberDeclarationsOrganizer.Comparer.cs (2)
83var xHasInitializer = ((FieldDeclarationSyntax)x).Declaration.Variables.Any(v => v.Initializer != null); 84var yHasInitializer = ((FieldDeclarationSyntax)y).Declaration.Variables.Any(v => v.Initializer != null);
Snippets\CSharpProprSnippetProvider.cs (1)
47if (precedingModifiers.Any(syntaxKind => syntaxKind is SyntaxKind.PrivateKeyword or SyntaxKind.ProtectedKeyword))
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertNamespaceAnalysis.cs (1)
77if (namespaceDeclaration.Members.Any(static m => m is BaseNamespaceDeclarationSyntax))
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
132if (member.Modifiers.Any(m => m.Kind() is SyntaxKind.PublicKeyword or SyntaxKind.ProtectedKeyword or SyntaxKind.InternalKeyword))
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (3)
142if (labels.Any(label => IsDefaultSwitchLabel(label))) 179if (switchStatement.Sections.Any(section => section.Labels.Any(label => IsDefaultSwitchLabel(label))))
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
51if (switchStatement.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
81.Any(field => field is { AssociatedSymbol: null, IsStatic: false, IsReadOnly: true });
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
94return compilationUnit.ChildNodes().Any(
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (2)
72if (arrowExpressionClause.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error)) 105if (nextToken.LeadingTrivia.Any(static t => t.Kind() is
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
86if (nextToken.LeadingTrivia.Any(static t => t.Kind() is
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
58.Any(declaringSyntax => IsInPropertyInitialization(declaringSyntax, node) || IsInFieldInitialization(declaringSyntax, node));
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
918if (arguments.Any(static a => a.NameColon != null))
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
160if (whenTrue.GetLeadingTrivia().Any(static t => t.GetStructure() is ConditionalDirectiveTriviaSyntax))
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
99if (localDeclaration.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
56if (expression.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
117property.AccessorList.Accessors.Any(static a => a.ExpressionBody != null || a.Body != null)) 522!syntaxRef.GetSyntax(cancellationToken).AncestorsAndSelf().Any(a => a == assignmentExpression))
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (2)
135if (switchLabels.Any(label => IsDefaultSwitchLabel(label))) 224.OrderBy(section => section.Labels.Any(label => IsDefaultSwitchLabel(label)))
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
162if (accessors.Any(a => a.Body != null || a.ExpressionBody != null) ||
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
103if (deconstruction is PositionalPatternClauseSyntax positionalPatternClause && positionalPatternClause.Subpatterns.Any(p => p.Pattern is not ConstantPatternSyntax))
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
99var seenNamedArgument = currentInvocation.ArgumentList.Arguments.Any(a => a.NameColon != null);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
283if (seenUsings.Any(seenUsingDirective => seenUsingDirective.IsEquivalentTo(usingDirective, topLevel: false)))
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
186if (!removedMembers.Any(kvp => kvp.Value.memberNode == priorMember)) 229if (!properties.Values.Any(v => v == current.Identifier.ValueText))
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
152var constructorContents = typeStructure.Content.Any(n => n is XmlElementSyntax { StartTag.Name.LocalName.ValueText: s_summaryTagName })
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
58if (typeArgumentList.Arguments.Any(a => a.Kind() != SyntaxKind.OmittedTypeArgument))
StringIndentation\CSharpStringIndentationService.cs (1)
82if (token.ContainsDiagnostics && token.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (33)
Semantics\InterpolationTests.cs (12)
533Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 534Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + " ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 535Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 536Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{ ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 537Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 538Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat + " ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 539Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat + "{").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 540Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat + "{ ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 558Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 576Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 595Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 1489Assert.True(SyntaxFactory.ParseSyntaxTree(text).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error));
Semantics\LambdaTests.cs (3)
6511.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.Attribute) || a.IsKind(SyntaxKind.DefaultExpression) || a.IsKind(SyntaxKind.InvocationExpression))) 6821.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.InvocationExpression))) 6850.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.InvocationExpression)))
Semantics\LocalFunctionTests.cs (4)
7641.Where(i => i.Ancestors().Any(a => a.Kind() is SyntaxKind.Attribute or SyntaxKind.TypeConstraint or SyntaxKind.DefaultExpression or SyntaxKind.InvocationExpression or SyntaxKind.EqualsValueClause)) 8686.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.Attribute) || a.IsKind(SyntaxKind.TypeConstraint) || a.IsKind(SyntaxKind.DefaultExpression) || a.IsKind(SyntaxKind.InvocationExpression))) 9554.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.Attribute))) 10174.Where(i => i.Ancestors().Any(a => a.IsKind(SyntaxKind.Attribute)))
Semantics\LookupTests.cs (6)
1843Assert.True(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1865Assert.False(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1887Assert.False(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1910Assert.False(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1932Assert.False(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1955Assert.True(symbols.Any(s => s.Kind == SymbolKind.TypeParameter));
Semantics\RawInterpolationTests.cs (8)
559Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 560Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + " ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 561Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 562Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{ ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 580Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 598Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 617Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 1163Assert.True(SyntaxFactory.ParseSyntaxTree(text).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
IncrementalParsing\IncrementalParsingTests.cs (8)
492Assert.True(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is AttributeSyntax)); 493Assert.False(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax)); 502Assert.False(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is AttributeSyntax)); 503Assert.True(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax)); 524Assert.False(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is AttributeSyntax)); 525Assert.True(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax)); 534Assert.True(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is AttributeSyntax)); 535Assert.False(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax));
LexicalAndXml\LexicalTests.cs (1)
3824Assert.False(tree.GetRoot().DescendantTokens().Any(
Parsing\LocalFunctionParsingTests.cs (1)
1289Assert.True(file.DescendantNodes().Any(n => n.Kind() == SyntaxKind.LocalFunctionStatement && !n.ContainsDiagnostics));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
1337bool hasTopLevelStatements = syntaxTrees.Any(s => s.GetRoot().ChildNodes().OfType<GlobalStatementSyntax>().Any());
Microsoft.CodeAnalysis.CSharp.Workspaces (30)
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (1)
47if (types.Any(s_shouldInclude))
CodeGeneration\CSharpSyntaxGenerator.cs (2)
1819if (!parameter.Identifier.TrailingTrivia.Any(t => t.IsSingleOrMultiLineComment())) 3668.Where(trivia => !trivia.Any(t => t.IsRegularOrDocComment()))
Rename\CSharpRenameRewriterLanguageService.cs (1)
164if (_conflictLocations.Any(cf => cf.Contains(lambda.Span)))
Simplification\CSharpSimplificationService.Expander.cs (3)
175if (parameters.Length > 0 && parameters.Any(p => p.Type == null)) 450var isInsideCref = originalSimpleName.AncestorsAndSelf(ascendOutOfTrivia: true).Any(n => n is CrefSyntax); 826if (typeArgumentsInSymbol.Intersect(typeArgumentsInOriginalDefinition).Any(n => !typeArgumentSymbols.Contains(n)))
Simplification\Simplifiers\NameSimplifier.cs (1)
643simplifiedNode.DescendantNodes().Any(n => n is PointerTypeSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
184if (parentExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArrowExpressionClauseSyntaxExtensions.cs (2)
43if (arrowExpression.ArrowToken.TrailingTrivia.Any(t => t.IsSingleOrMultiLineComment())) 46if (arrowExpression.ArrowToken.LeadingTrivia.Any(t => t.IsSingleOrMultiLineComment()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (2)
96if (parsed.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error)) 195expression = firstStatement.GetLeadingTrivia().Any(t => t.IsDirective || t.IsSingleOrMultiLineComment())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
861if (expression.GetLeadingTrivia().Any(t => t.IsDirective)) 881if (expression.GetLeadingTrivia().Any(t => t.IsSingleOrMultiLineComment()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ILocalSymbolExtensions.cs (1)
45return typeParameters.HasValue && typeParameters.Value.Any(typeParameter => typeParameter.Identifier.ValueText == name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (3)
449=> node.DescendantNodes(n => n == node || !n.IsReturnableConstruct()).Any(n => n is YieldStatementSyntax); 603var hasLeadingDirective = node.GetLeadingTrivia().Any(t => SyntaxFacts.IsPreprocessorDirective(t.Kind())); 901var hasTrailingComments = from.GetTrailingTrivia().Any(t => t.IsRegularComment());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
411=> node.Ancestors().Any(n => n.Kind() is
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
137.Any(node => node.IsKind(SyntaxKind.StackAllocArrayCreationExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
35if (!firstUsing.GetLeadingTrivia().Any(t => t.IsEndOfLine())) 48!currentUsing.GetLeadingTrivia().Any(t => t.IsEndOfLine()))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
253if (!info.Context.GenerateDocumentationComments || node.GetLeadingTrivia().Any(t => t.IsDocComment()))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (2)
163if (root.Usings[i].GetLeadingTrivia().Any(trivia => trivia.IsKind(SyntaxKind.IfDirectiveTrivia))) 168if (root.Usings[i].GetLeadingTrivia().Any(trivia => trivia.IsKind(SyntaxKind.EndIfDirectiveTrivia)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1706=> tuple.Arguments.Any(a => a.NameColon != null);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
101if (reference.GetSyntax().ChildTokens().Any(t => t.IsKind(SyntaxKind.UnsafeKeyword)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
127=> trivia.Any(t => !t.IsWhitespaceOrEndOfLine());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
50if (localDeclarationStatement.Declaration.Variables.Any(IsDiscardDeclaration))
Microsoft.CodeAnalysis.EditorFeatures (10)
Editor\TextBufferAssociatedViewService.cs (1)
127return views.Any(HasFocus);
EditorConfigSettings\Data\AnalyzerSetting.cs (1)
36IsNotConfigurable = descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.NotConfigurable);
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (2)
721_anchor.HasValue && _openTextBufferManager._referenceSpanToLinkedRenameSpanMap.Keys.Any(s => s.OverlapsWith(anchorSpan)) 727_active.HasValue && _openTextBufferManager._referenceSpanToLinkedRenameSpanMap.Keys.Any(s => s.OverlapsWith(activeSpan))
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (1)
156return changedText.Any(c => !IsTrackableCharacter(syntaxFactsService, c));
Shared\Extensions\IBufferGraphExtensions.cs (1)
116top.SourceBuffers.OfType<IProjectionBufferBase>().Any(b => IsSourceBuffer(b, bottom));
Shared\Extensions\IContentTypeExtensions.cs (1)
20=> extensionContentTypes.Any(v => dataContentType.IsOfType(v));
Shared\Extensions\ITextViewExtensions.cs (1)
31return spansInView.Any(spanInView => textView.TextBuffer.IsReadOnly(spanInView.Span));
Shared\Extensions\MefExtensions.cs (1)
39return extensions.Where(h => contentTypes.Any(d => d.MatchesAny(h.Metadata.ContentTypes))).ToList();
Shared\Tagging\Utilities\TagSpanIntervalTree.cs (1)
258if (!requestedSpans.Any(s => s.IntersectsWith(span)))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
AbstractCommandHandlerTestState.cs (1)
77var cursorDocument = Workspace.Documents.First(d => d.CursorPosition.HasValue || d.SelectedSpans.Any(ss => ss.IsEmpty));
SignatureHelp\AbstractSignatureHelpProviderTests.cs (1)
425!expectedOrderedItemsOrNull.Any(i => i.IsSelected))
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
Completion\GlobalAssemblyCacheCompletionHelperTests.cs (1)
39Assert.True(completions.Any(c => c.DisplayText == completionItem));
SymbolFinder\DependentTypeFinderTests.cs (5)
454Assert.True(transitiveDerived.Any(d => !Equals(d.BaseType, rootType)), "At least one result must not immediately derive from the type"); 503Assert.True(transitiveDerived.Any(d => !d.Interfaces.Contains(rootType)), "At least one result must not immediately derive from the type"); 555Assert.True(transitiveImpls.Any(d => !d.Interfaces.Contains(rootType)), "At least one result must not immediately derive from the type"); 583Assert.True(delegates.Any(i => i.Locations.Any(loc => loc.IsInMetadata)), "We should find a metadata delegate"); 613Assert.True(enums.Any(i => i.Locations.Any(loc => loc.IsInMetadata)), "We should find a metadata enum");
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
Debugger\Engine\DkmClrValue.cs (1)
222if (type.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly).Any(m => m.Name == "ToString"))
Debugger\MemberInfo\TypeImpl.cs (1)
459if (map.TargetMethods.Any(m => m.DeclaringType == t))
Microsoft.CodeAnalysis.Features (44)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
160if (!typeSymbol.GetMembers().OfType<IMethodSymbol>().Any(IsDebuggerDisplayMethod))
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (1)
151(trivia.HasStructure && trivia.GetStructure().DescendantTrivia().Any(fixer.IsEndOfLine));
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (1)
192return TopLevelTypeDeclarations(root).Any(
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
800import => importsToRemove.Any(importToRemove => syntaxFacts.AreEquivalent(importToRemove, import)),
Completion\CompletionService.cs (1)
337var filterTextHasNoUpperCase = !filterText.Any(char.IsUpper);
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
54if (allAnonymousNodes.Any(t => !anonymousType.Equals(t.symbol, SymbolEqualityComparer.Default)))
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
42if (from.GetDiagnostics().Any(d => d.DefaultSeverity == DiagnosticSeverity.Error))
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
81if (ifStatement == null || ifStatement.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
100if (interpolatedString.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
768map.Any(entry => IsGlobalStatement(entry.Key)))
EditAndContinue\RudeEditDiagnostic.cs (1)
63=> diagnostics.Any(static e => e.Kind.IsBlocking());
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (2)
117if (ae.InnerExceptions.Any(e => e is not OperationCanceledException) || 118ae.InnerExceptions.Cast<OperationCanceledException>().Any(NotOurShutdownToken))
ExtractMethod\MethodExtractor.Analyzer.cs (2)
406return symbols.Any(map.Contains); 629return tokens.Any(t => semanticFacts.IsWrittenTo(model, t.Parent, CancellationToken.None));
ExtractMethod\MethodExtractor.TriviaResult.cs (1)
55if (list.Any(t => t.RawKind != _endOfLineKind && t.RawKind != _whitespaceKind))
ExtractMethod\MethodExtractor.VariableSymbol.cs (1)
304=> list.Any(t => !_nonNoisySet.Contains(t.RawKind));
ExtractMethod\SelectionValidator.cs (1)
123if (textSpan.End <= stmt.Span.End && spine.Any(s => CanMergeExistingSpineWithCurrent(syntaxFacts, s, stmt)))
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (3)
128.Any(m => m.MethodKind == MethodKind.UserDefinedOperator && 160.Any(m => m.Parameters.Length == 1 && !m.IsStatic); 164.Any(m => m.Parameters.Length == 0 && !m.IsStatic);
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
377if (!triggeringProject.ProjectReferences.Any(pr => pr.ProjectId == projectToBeUpdated.Id))
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
228containsClassSpecificStatement = operation.Descendants().Any(op => op.Kind == OperationKind.InstanceReference);
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (1)
196var hasAtLeastOneTupleWhichAppearsMultipleTimes = transitiveReferences.Any(kvp => kvp.Key.IsTupleType && kvp.Value.count >= 2);
Organizing\AbstractOrganizingService.cs (1)
40o.SyntaxNodeTypes.Any(t2 => t1 == t2 || t1.GetTypeInfo().IsSubclassOf(t2))
Rename\SymbolicRenameInfo.cs (2)
235if (solution.Projects.Any(p => p.IsSubmission && p.ProjectReferences.Any(r => r.ProjectId == projectIdOfLocation)))
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
146.Any(m => m.Parameters.Length == 0);
Shared\Utilities\ExtractTypeHelpers.cs (1)
189if (includedMembers.Any(m => DoesMemberReferenceTypeParameter(m, typeParameter, [])))
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
43Debug.Assert(!supportedDiagnostics.Any(descriptor => descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer);
src\Analyzers\Core\Analyzers\AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (2)
93if (descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) 132if (descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary))
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (1)
37s_diagnosticIdToLanguageSpecificOptionsMap.Values.Any(map => map.ContainsKey(diagnosticId));
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
52if (node.ContainsDiagnostics && node.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
130if (root.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
81if (syntax.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
118if (context.Operation.Syntax.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
572NonConstructorLocations(writeLocations1).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 585NonConstructorLocations(writeLocations2).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration)))
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
148.Any(nameAttributes => nameAttributes.Select(GetValueFromNameAttribute).Contains(name));
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
184return NameGenerator.EnsureUniqueness(parameterNames, isFixed, canUse: s => !reservedNames.Any(n => comparer.Equals(s, n)))
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
608if (typeArguments.Any(a => !a.IsBound))
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
312var hasDirective = nodeToRemove.GetLeadingTrivia().Any(t => t.IsDirective);
Wrapping\AbstractWrapper.cs (1)
66=> declaration.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error && d.Location.SourceSpan.OverlapsWith(headerSpan));
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
132: expectedResults.Any(r => r.Diagnostics.Any()) ? AllRuntimeCapabilities : EditAndContinueCapabilities.Baseline;
EditAndContinue\SourceMarkers.cs (1)
107Contract.ThrowIfTrue(result.Any(span => span == default));
Microsoft.CodeAnalysis.LanguageServer (1)
ExportProviderBuilder.cs (1)
90var hasUnexpectedErroredParts = erroredParts.Any(part => !expectedErroredParts.Contains(part));
Microsoft.CodeAnalysis.LanguageServer.Protocol (11)
Extensions\ProtocolConversions.cs (1)
225Debug.Assert(!path.Split(System.IO.Path.DirectorySeparatorChar).Any(p => p == "." || p == ".."));
Features\CodeCleanup\AbstractCodeCleanupService.cs (4)
256solutionChanges.GetProjectChanges().Any( 266projectChanges.GetChangedDocuments().Any(documentId => documentId != updatedDocument.Id) || 267projectChanges.GetChangedAdditionalDocuments().Any(documentId => documentId != updatedDocument.Id) || 268projectChanges.GetChangedAnalyzerConfigDocuments().Any(documentId => documentId != updatedDocument.Id));
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
66if (tree.GetDiagnostics(cancellationToken).Any(d => d.Severity == DiagnosticSeverity.Error))
Handler\CodeActions\CodeActionResolveHelper.cs (3)
111if (projectChange.GetChangedDocuments().Any(docId => HasDocumentNameChange(docId, newSolution, solution)) 112|| projectChange.GetChangedAdditionalDocuments().Any(docId => HasDocumentNameChange(docId, newSolution, solution) 113|| projectChange.GetChangedAnalyzerConfigDocuments().Any(docId => HasDocumentNameChange(docId, newSolution, solution))))
Handler\SourceGenerators\SourceGeneratorRefreshQueue.cs (1)
121var hasOpenSourceGeneratedDocuments = _lspWorkspaceManager.GetTrackedLspText().Keys.Any(uri => uri.Scheme == SourceGeneratedDocumentUri.Scheme);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
364Debug.Assert(!concurrentlyExecutingTasks.Any(t => !t.Key.IsCompleted), "The tasks should have all been drained before continuing");
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (1)
GlobalAssemblyCacheTests.cs (1)
115Assert.True(gacLocationsUpper.Any(gac => location.StartsWith(gac, StringComparison.OrdinalIgnoreCase)), "Path within some GAC root");
Microsoft.CodeAnalysis.Test.Utilities (8)
Assert\AssertEx.cs (3)
285if (!diff.Lines.Any(line => line.Type == ChangeType.Inserted || line.Type == ChangeType.Deleted)) 507var none = !actual.Any(predicate); 519var any = actual.Any(predicate);
Compilation\ControlFlowGraphVerifier.cs (1)
578Any(n =>
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (1)
246if (nodeOrToken.IsToken && _spans.Any(s => s.OverlapsWith(nodeOrToken.FullSpan)))
Diagnostics\ThrowingDiagnosticAnalyzer.cs (2)
99Assert.True(!handled.Any(h => h == false) && handled.Any(h => true), Environment.NewLine +
TestHelpers.cs (1)
38return t.GetFields(BindingFlags.Public | BindingFlags.Static).Any(f => type.IsAssignableFrom(f.FieldType));
Microsoft.CodeAnalysis.VisualBasic (6)
OptionsValidator.vb (1)
55If Not errors.Any(Function(diag) diag.Severity = DiagnosticSeverity.Error) Then
Syntax\SyntaxNodeRemover.vb (2)
45MyBase.New(nodes.Any(Function(n) n.IsPartOfStructuredTrivia())) 96Return trivia.Any(Function(t) IsEndOfLine(t))
Syntax\SyntaxReplacer.vb (3)
89Me._visitStructuredTrivia = Me._nodeSet.Any(Function(n) n.IsPartOfStructuredTrivia()) OrElse 90Me._tokenSet.Any(Function(t) t.IsPartOfStructuredTrivia()) OrElse 91Me._triviaSet.Any(Function(t) t.IsPartOfStructuredTrivia())
Microsoft.CodeAnalysis.Workspaces (39)
Diagnostics\DiagnosticAnalysisResult.cs (3)
78Debug.Assert(!syntaxLocals.Values.Any(item => item.IsDefault)); 79Debug.Assert(!semanticLocals.Values.Any(item => item.IsDefault)); 80Debug.Assert(!nonLocals.Values.Any(item => item.IsDefault));
Editing\SymbolEditor.cs (1)
411var declaration = this.GetDeclarations(currentSymbol).FirstOrDefault(d => memberDecls.Any(md => md.SyntaxTree == d.SyntaxTree && d.FullSpan.IntersectsWith(md.FullSpan)));
Editing\SyntaxGenerator.cs (2)
242return method.ReturnType.GetReferencedTypeParameters().Any(t => IsNullableAnnotatedTypeParameter(typeParameter, t)) || 243method.Parameters.Any(p => p.Type.GetReferencedTypeParameters().Any(t => IsNullableAnnotatedTypeParameter(typeParameter, t)));
FindSymbols\FindReferences\DependentProjectsFinder.cs (2)
236if (!dependentProjects.Any(dp => dp.project.Id == pId)) 316return project.ProjectReferences.Any(p => p.ProjectId == symbolOrigination.sourceProject.Id);
Rename\ConflictEngine\ConflictResolver.cs (1)
282if (otherThingsNamedTheSame.Any(s => s.IsKind(SymbolKind.Namespace)))
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
547if (newLocations.Any(loc => loc.SourceSpan.Start == adjustedStartPosition))
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
73if (startingPosition >= c.OriginalSpan.End && !appliedTextSpans.Any(s => s.Contains(c.OriginalSpan))) 82if (!appliedTextSpans.Any(s => s.Contains(oldSpan)))
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (1)
191return waiters.Any(w => w.HasPendingWork);
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
661return sequence.Any(predicate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (7)
655return getAwaiters.Any(VerifyGetAwaiter); 671if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 689return methods.Any(m => m.Name == WellKnownMemberNames.GetResult && !m.Parameters.Any()); 710if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 716if (!members.OfType<IMethodSymbol>().Any(x => 750if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 759if (!members.OfType<IMethodSymbol>().Any(x => x.Name == WellKnownMemberNames.MoveNextAsyncMethodName))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
61return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
411.Any(m => m.Parameters.Any());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
290if (list.Any(o => o != null && o.TextSpan.Contains(position)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
95if (operations.Any(o => o.TextSpan.Contains(span)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
247=> list.Any(syntaxFacts.IsPreprocessorDirective); 862=> node.ChildNodes().Any(c => c.RawKind == syntaxFacts.SyntaxKinds.GlobalStatement);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
117return availableIndices != null && availableIndices.Any(b => b);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
180if (nextToken != default && !commaToken.TrailingTrivia.Any(t => t.RawKind == syntaxKinds.EndOfLineTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (1)
175=> arg.removeAttributeTypes.Any(attr => attr.Equals(a.AttributeClass)) ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (1)
70=> arg.attributesToRemove.Any(attr => attr.Equals(a.AttributeClass)) ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (5)
48private bool HasAliases(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsAlias); 49private bool HasUsings(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsSimpleUsing); 50private bool HasStaticUsings(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsStaticUsing); 79if (GetUsingsAndAliases(node).Any(u => IsEquivalentImport(u, import))) 84if (GetExterns(node).Any(u => IsEquivalentImport(u, import)))
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
911if (!provider.Metadata.Extensions.Any(e => string.Equals(e, extension, StringComparison.OrdinalIgnoreCase)))
Workspace\Solution\Project.cs (1)
462return results.Any(b => b);
Workspace\Workspace.cs (1)
1702&& projectChanges.GetChangedDocuments().Any(id => projectChanges.NewProject.GetDocument(id)!.HasInfoChanged(projectChanges.OldProject.GetDocument(id)!)))
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (1)
381=> from.ProjectReferences.Any(pr => pr.ProjectId == to);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
MSBuild\ProjectFile\CommandLineArgumentReader.cs (2)
29if (string.IsNullOrEmpty(name) || name.Any(char.IsWhiteSpace)) 46if (string.IsNullOrEmpty(value) || (addQuoteIfValueContainsWhitespace && value.Any(char.IsWhiteSpace)))
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
661return sequence.Any(predicate);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
VisualStudioMSBuildWorkspaceTests.cs (4)
224Assert.True(projects[0].ProjectReferences.Any(r => r.ProjectId == projects[1].Id) || 225projects[1].ProjectReferences.Any(r => r.ProjectId == projects[0].Id)); 231Assert.True(compilation1.References.OfType<CompilationReference>().Any(c => c.Compilation == compilation2) || 232compilation2.References.OfType<CompilationReference>().Any(c => c.Compilation == compilation1));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
MEF\ExportProviderCache.cs (1)
104return types.Any(excludedType => excludedType.IsAssignableFrom(part.Type));
Microsoft.CodeAnalysis.Workspaces.UnitTests (21)
FindAllDeclarationsTests.cs (1)
709Assert.False(foundDeclarations.Any(decl => decl == null));
SolutionTests\SolutionTests.cs (9)
3093Assert.True(sol2.GetProject(pid2).AllProjectReferences.Any(r => r.ProjectId == pid), "sol2 project pid2 was expected to contain project reference " + pid); 3118Assert.True(sol2.GetProject(pid2).AllProjectReferences.Any(r => r.ProjectId == pid), "sol2 pid2 was expected to contain " + pid); 5001Assert.True(compilation1.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation2)); 5029Assert.True(compilation2.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation1)); 5126Assert.True(compilation1New.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation2)); 5127Assert.True(compilation1New.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation3)); 5174Assert.True(compilation1.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation2)); 5175Assert.True(compilation1.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation3)); 5219Assert.False(compilation1.References.Any(r => r is CompilationReference));
SymbolKeyTests.cs (11)
151Assert.True(symbols.Any(s => s is IFieldSymbol { MetadataName: "" })); 167Assert.True(symbols.Any(s => s is IFieldSymbol { MetadataName: "" })); 183Assert.True(symbols.Any(s => s is IFieldSymbol { MetadataName: "" })); 198Assert.False(symbols.Any(s => s is IFieldSymbol { MetadataName: "" })); 213Assert.True(symbols.Any(s => s is IFieldSymbol { MetadataName: "" })); 228Assert.False(symbols.Any(s => s is IFieldSymbol { MetadataName: "" })); 243Assert.True(symbols.Any(s => s is IFieldSymbol { MetadataName: "" })); 258Assert.False(symbols.Any(s => s is IFieldSymbol { MetadataName: "" })); 273Assert.True(symbols.Any(s => s is IFieldSymbol { MetadataName: "" })); 289Assert.True(symbols.Any(s => s is IEventSymbol { MetadataName: "" })); 305Assert.True(symbols.Any(s => s is IEventSymbol { MetadataName: "" }));
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
RequestExecutionQueue.cs (1)
364Debug.Assert(!concurrentlyExecutingTasks.Any(t => !t.Key.IsCompleted), "The tasks should have all been drained before continuing");
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Property.cs (1)
53types.Any(type => type.Name == "IsExternalInit" && !type.IsNested && type.Namespace == "System.Runtime.CompilerServices");
Microsoft.DotNet.AsmDiff (4)
AssemblySet.cs (1)
149if (assembliesSnapshot.Any(a => !loadedAssembliesSet.Contains(a)))
Csv\DiffUnsafeCsvColumn.cs (2)
35return property.Accessors.Any(a => CSharpCciExtensions.IsMethodUnsafe(a.ResolvedMethod)); 39return evnt.Accessors.Any(a => a.ResolvedMethod.IsMethodUnsafe());
DiffCciFilter.cs (1)
38return ns.GetTypes(IncludeForwardedTypes).Any(Include);
Microsoft.DotNet.Build.Tasks.Feed (4)
src\common\LatestLinksManager.cs (1)
68if (AccountsWithCdns.Any(account => feedBaseUrl.Contains(account)))
src\PublishArtifactsInManifest.cs (1)
264if (tasks.Any(t => t == null))
src\SigningInformationModelFactory.cs (2)
55if (!blobArtifacts.Any(b => Path.GetFileName(b.Id).Equals(fileName, StringComparison.OrdinalIgnoreCase)) && 56!packageArtifacts.Any(p => $"{p.Id}.{p.Version}.nupkg".Equals(fileName, StringComparison.OrdinalIgnoreCase)))
Microsoft.DotNet.Build.Tasks.Packaging (8)
CreateTrimDependencyGroups.cs (1)
165if (!runtimeAssets.Any(r => Path.GetFileName(r).Equals(fileName, StringComparison.OrdinalIgnoreCase)))
GenerateRuntimeDependencies.cs (1)
102if (runtimeGroup.Any(d => d.ItemSpec == c_emptyDependency))
GetPackageDestination.cs (1)
116if (packageTargetFramework.MetadataNames.Cast<string>().Any(md => md.Equals("TargetRuntime")))
NuGetPack.cs (1)
276if (!pathHasMatches.Values.Any(i => i))
PackageIndex.cs (1)
594return mappings.Keys.Any(fxVer => fxVer <= framework.Version);
UpdatePackageIndex.cs (1)
332if (index.ModulesToPackages.Values.Any(p => p.Equals(id)))
ValidatePackage.cs (1)
425if (index.ModulesToPackages.Values.Any(p => p.Equals(PackageId)))
ValidationTask.cs (1)
93return frameworkValues.Any(fx => values.Contains(fx));
Microsoft.DotNet.Build.Tasks.TargetFramework (1)
ChooseBestTargetFrameworksTask.cs (1)
38if (bestTargetFramework != null && (!Distinct || !bestTargetFrameworkList.Any(b => b.ItemSpec == bestTargetFramework)))
Microsoft.DotNet.Build.Tasks.Workloads (4)
CreateVisualStudioWorkload.wix.cs (1)
202if ((workload is WorkloadDefinition wd) && (wd.Platforms == null || wd.Platforms.Any(platform => platform.StartsWith("win"))) && (wd.Packs != null))
Swix\SwixComponent.cs (1)
200if (pack.IsAlias && pack.AliasTo != null && !pack.AliasTo.Keys.Any(rid => s_SupportedRids.Contains(rid)))
WorkloadPackageBase.cs (2)
258if (exclusionPatterns.Any(pattern => Regex.IsMatch(file, pattern))) 282if (string.IsNullOrEmpty(version.Prerelease) || version.Prerelease.Split('.').Any(s => string.Equals("ci", s) || string.Equals("dev", s)))
Microsoft.DotNet.GenAPI (1)
GenAPITask.cs (1)
245assemblies.Any(assembly => assembly.Attributes.HasAttributeOfType(InternalsVisibleTypeName));
Microsoft.DotNet.Helix.Sdk (1)
ProvisioningProfileProvider.cs (1)
157if (!zipArchive.Entries.Any(e => e.FullName == ProfileFileName))
Microsoft.DotNet.Internal.DependencyInjection.Testing (1)
DependencyInjectionValidation.cs (1)
260return s_exemptTypes.Contains(type.FullName) || s_exemptNamespaces.Any(n => type.FullName.StartsWith(n));
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\AssertEx.cs (2)
281var none = !actual.Any(predicate); 293var any = actual.Any(predicate);
Microsoft.DotNet.PackageTesting (1)
GetCompatiblePackageTargetFrameworks.cs (1)
76if (!string.IsNullOrEmpty(minDotnetTargetFramework) && frameworksToTest.Any(t => t.Framework == ".NETStandard"))
Microsoft.DotNet.SharedFramework.Sdk (1)
src\CreateFrameworkListFile.cs (1)
269?.Any(prefix => item.GetMetadata("TargetPath")?.StartsWith(prefix) == true) ?? true;
Microsoft.DotNet.SignCheckLibrary (11)
Logging\Log.cs (1)
17return _loggers.Any(l => l.HasLoggedErrors);
Verification\Exclusions.cs (4)
98return exclusions.Any(e => (e.FilePatterns.All(fp => String.IsNullOrEmpty(fp)) && IsMatch(e.ParentFiles, parent))); 134return _exclusions.Any(e => IsMatch(e.FilePatterns, path)); 144return _exclusions.Any(e => IsMatch(e.ParentFiles, parent)); 149return patterns.Any(p => IsMatch(p, value));
Verification\Jar\JarFile.cs (2)
99HasSignatureFile = jarArchive.Entries.Any( 105HasManifestFile = jarArchive.Entries.Any(
Verification\Jar\JarSignatureFile.cs (1)
38return MainAttributes.Keys.Any(key => key.EndsWith("-Digest-Manifest-Main-Attributes"));
Verification\SignatureVerificationManager.cs (3)
234if (zipArchive.Entries.Any(z => String.Equals(Path.GetExtension(z.FullName), "nuspec", StringComparison.OrdinalIgnoreCase))) 239else if (zipArchive.Entries.Any(z => String.Equals(Path.GetExtension(z.FullName), "vsixmanifest", StringComparison.OrdinalIgnoreCase))) 244else if (zipArchive.Entries.Any(z => String.Equals(z.FullName, "META-INF/MANIFEST.MF", StringComparison.OrdinalIgnoreCase)))
Microsoft.DotNet.SignTool (4)
src\Configuration.cs (2)
116Debug.Assert(itemsToSign != null && !itemsToSign.Any(i => i == null)); 245hasSignableParts = _zipDataMap[fileSignInfo.FileContentKey].NestedParts.Values.Any(b => b.FileSignInfo.SignInfo.ShouldSign || b.FileSignInfo.HasSignableParts);
src\SignToolTask.cs (1)
398if(map[extension].Any(m => m.CollisionPriorityId == signInfo.CollisionPriorityId))
src\VerifySignatures.cs (1)
87return File.ReadLines(filePath).Any(line => line.IndexOf("# SIG # Begin Signature Block", StringComparison.OrdinalIgnoreCase) >= 0);
Microsoft.DotNet.SourceBuild.Tasks (1)
src\UsageReport\ValidateUsageAgainstBaseline.cs (1)
170return ignoreUsageRegexes.Any(r => r.IsMatch(id));
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (3)
DefaultHelpers.cs (1)
15return arguments.Any(arg => arg);
Languages\angular\Angular.cs (1)
353return type.Properties.Any(p => p.Required);
Languages\csharp\CSharp.cs (1)
251return classType.Properties.Any(p => p.Required && IsNullable(p.Type));
Microsoft.DotNet.VersionTools (2)
Automation\PullRequestCreator.cs (1)
247if (pr.Labels?.Any(IsMaestroStopUpdatesLabel) ?? false)
BuildManifest\VersionIdentifier.cs (1)
167(prevDelimiterCharacter != '-' || !_knownTags.Any(tag => nextSegment.StartsWith(tag, StringComparison.OrdinalIgnoreCase))))
Microsoft.DotNet.VersionTools.Cli (1)
VersionTrimmingOperation.cs (1)
45if (assets.Any(a => Path.GetExtension(a) != ".nupkg"))
Microsoft.Extensions.Caching.SqlServer (1)
DatabaseOperations.cs (1)
366return ex.Errors.Cast<SqlError>().Any(error => error.Number == DuplicateKeyErrorId);
Microsoft.Extensions.Configuration.Binder (2)
ConfigurationBinder.cs (2)
251if (constructorParameters is null || !constructorParameters.Any(p => p.Name == property.Name)) 513type.IsValueType || constructors.Any(ctor => ctor.GetParameters().Length == 0);
Microsoft.Extensions.DependencyInjection.AutoActivation (4)
AutoActivationExtensions.cs (2)
317if (services.Any(d => d.ServiceType == descriptor.ServiceType && d.ServiceKey == descriptor.ServiceKey)) 328if (services.Any(d => d.ServiceType == descriptor.ServiceType && d.ServiceKey == descriptor.ServiceKey))
AutoActivationExtensions.Keyed.cs (2)
351if (services.Any(d => d.ServiceType == descriptor.ServiceType && d.ServiceKey == descriptor.ServiceKey)) 362if (services.Any(d => d.ServiceType == descriptor.ServiceType && d.ServiceKey == descriptor.ServiceKey))
Microsoft.Extensions.Identity.Core (4)
PasswordValidator.cs (3)
56if (options.RequireDigit && !password.Any(IsDigit)) 61if (options.RequireLowercase && !password.Any(IsLower)) 66if (options.RequireUppercase && !password.Any(IsUpper))
UserValidator.cs (1)
62userName.Any(c => !manager.Options.User.AllowedUserNameCharacters.Contains(c)))
Microsoft.Extensions.Options.SourceGeneration (4)
Parser.cs (1)
203.Any(m => m.Parameters.Length == NumValidationMethodArgs
ParserUtilities.cs (3)
38syntax.Modifiers.Any(m => m.IsKind(modifierToSearch))); 81if (type.GetMembers(propertyName).OfType<IPropertySymbol>().Any(property => 95if (interfaceType.GetMembers(propertyName).OfType<IPropertySymbol>().Any(property =>
Microsoft.Extensions.Resilience (1)
Resilience\ResilienceServiceCollectionExtensions.cs (1)
43if (services.Any(s => s.ServiceType == typeof(ResilienceMetricsEnricher)))
Microsoft.Gen.ContextualOptions (1)
Parser.cs (1)
54if (!type.Definitions.Any(def => def.Modifiers.Any(static token => token.IsKind(SyntaxKind.PartialKeyword))))
Microsoft.Gen.Logging (2)
Parsing\TypeSymbolExtensions.cs (1)
82if (current.GetMembers("ToString").Where(m => m.Kind == SymbolKind.Method && m.DeclaredAccessibility == Accessibility.Public).Cast<IMethodSymbol>().Any(m => m.Parameters.Length == 0))
src\Generators\Shared\ParserUtilities.cs (1)
43syntax.Modifiers.Any(m => m.IsKind(modifierToSearch)));
Microsoft.Gen.Metrics (1)
src\Generators\Shared\ParserUtilities.cs (1)
43syntax.Modifiers.Any(m => m.IsKind(modifierToSearch)));
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\ParserUtilities.cs (1)
43syntax.Modifiers.Any(m => m.IsKind(modifierToSearch)));
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSManagedTypeInfo.cs (2)
150if (argumentTypes.Any(x => x is null)) 161if (signatureTypes.Any(x => x is null))
Microsoft.ML.AutoML (10)
AutoMLExperiment\IStopTrainingManager.cs (1)
135return _managers.Any(m => m.IsStopTrainingRequested());
ColumnInference\ColumnGroupingInference.cs (1)
99while (previousColumns.Any(x => x.SuggestedName == name))
ColumnInference\TextFileSample.cs (1)
294if (buffer.Take(sniffLim).Any(x => x == 0))
Experiment\Experiment.cs (1)
71if (_history.Any(r => r.RunSucceeded))
TrainerExtensions\BinaryTrainerExtensions.cs (2)
39if (!sweepParams.Any(p => p.Name == "NumberOfIterations")) 51if (sweepParams == null || !sweepParams.Any(p => p.Name != "NumberOfIterations"))
TransformInference\TransformInference.cs (2)
112obj.ColumnsConsumed.All(cc => ColumnsConsumed.Any(cc.Equals)) && 113obj.ColumnsProduced.All(cp => ColumnsProduced.Any(cp.Equals));
Tuner\AutoZeroTuner.cs (1)
85if (_pipelineStrings.Any(kv => kv.Value.Contains("OneHotHashEncoding") || kv.Value.Contains("OneHotEncoding")))
Utils\BestResultUtil.cs (1)
62results = results.Where(r => r.Results != null && r.Results.Any(x => x.ValidationMetrics != null));
Microsoft.ML.Benchmarks.Tests (1)
BenchmarksTest.cs (1)
69Assert.True(summary.Reports.All(r => r.ExecuteResults.Any(er => er.FoundExecutable && er.Results.Any())),
Microsoft.ML.Core (4)
CommandLine\CmdParser.cs (1)
1699else if (Unique && val.Values.Any(x => x.Value.Equals(newValue)))
ComponentModel\ComponentCatalog.cs (2)
427if (Aliases != null && Aliases.Any(x => !IsValidName(x))) 900return aliases.Any(a => string.Equals(name, a, StringComparison.OrdinalIgnoreCase));
ComponentModel\LoadableClassAttribute.cs (1)
171if (loadNames.Any(s => string.IsNullOrWhiteSpace(s)))
Microsoft.ML.Data (20)
Data\SchemaDefinition.cs (1)
456if (dims != null && dims.Any(d => d < 0))
DataLoadSave\EstimatorChain.cs (1)
42Contracts.Assert((_host != null) == _needCacheAfter.Any(x => x));
DataLoadSave\LegacyCompositeDataLoader.cs (1)
152if (!string.IsNullOrEmpty(pair.Key) && composite._transforms.Any(x => x.Tag == pair.Key))
DataLoadSave\Text\TextLoader.cs (1)
720if (!needInputSize && col.Source.Any(r => r.AutoEnd && r.Max == null))
DataView\RowToRowMapperTransform.cs (2)
184if (_bindings.AddedColumnIndices.Any(predicate)) 207if (inputs.Length == 1 && n > 1 && _bindings.AddedColumnIndices.Any(predicate))
DataView\Transposer.cs (2)
877bool isActive = pred == null || Enumerable.Range(offset, splitter.OutputSchema.Count).Any(c => pred(c)); 1451bool hasZero = columnsNeeded != null && columnsNeeded.Any(x => x.Index == 0);
EntryPoints\EntryPointNode.cs (1)
642((JArray)pair.Value).Any(tok => VariableBinding.IsBindingToken(tok)))
EntryPoints\InputBuilder.cs (1)
96return aliases.Any(a => string.Equals(name, a, StringComparison.OrdinalIgnoreCase));
Model\Pfa\PfaContext.cs (2)
207public bool ContainsCell(string name) => _cellBlocks.Any(c => c.Name == name); 211public bool ContainsFunc(string name) => _funcBlocks.Any(b => b.Name == name);
Transforms\ColumnConcatenatingEstimator.cs (1)
59_host.CheckParam(!inputColumnNames.Any(r => string.IsNullOrEmpty(r)), nameof(inputColumnNames),
Transforms\ColumnConcatenatingTransformer.cs (1)
96if (Source == null || Source.Any(kvp => !string.IsNullOrEmpty(kvp.Key)))
Transforms\MetadataDispatcher.cs (4)
60Contracts.CheckParam(!getters.Any(g => g == null), nameof(getters), "Invalid getter info"); 364Contracts.CheckParam(!kindsSrc.Any(k => string.IsNullOrWhiteSpace(k)), nameof(kindsSrc)); 415if (_getters != null && _getters.Any(g => g.Kind == kind)) 431if (_getters != null && _getters.Any(g => g.Kind == kind))
Transforms\RowToRowTransformerBase.cs (1)
94if (disposers.Any(x => x != null))
Transforms\TransformBase.cs (1)
738Func<int, bool> needCol = c => columnsNeeded == null ? false : columnsNeeded.Any(x => x.Index == c);
Microsoft.ML.Ensemble (1)
Trainer\EnsembleTrainerBase.cs (1)
103normalization: Trainers.Any(t => t.Info.NeedNormalization),
Microsoft.ML.FastTree (5)
Dataset\Dataset.cs (3)
824if (partsDatas.Any(pd => pd.Data != null && pd.IsQueryLevel != isQuery)) 843if (arrays.Any(x => x != null && t != x.GetType().GetElementType())) 983Enumerable.Range(_dataset._flockToFirstFeature[f], _dataset._flocks[f].Count).Any(i => active[i]) ==
TreeEnsemble\InternalRegressionTree.cs (2)
109if (CategoricalSplit.Any(b => b)) 449if (CategoricalSplit.Any(x => x))
Microsoft.ML.GenAI.LLaMA (5)
Llama3_1ChatTemplateBuilder.cs (5)
23if (messages.Any(m => m.GetContent() is null)) 28if (messages.Any(m => m.GetRole() is null || availableRoles.Contains(m.GetRole()!.Value) == false)) 94if (messages.Any(m => m.Text is null)) 99if (messages.Any(m => availableRoles.Any(availableRole => availableRole == m.Role) == false))
Microsoft.ML.GenAI.Phi (5)
Phi3\Phi3ChatTemplateBuilder.cs (5)
28if (messages.Any(m => m.GetContent() is null)) 33if (messages.Any(m => m.GetRole() is null || availableRoles.Contains(m.GetRole()!.Value) == false)) 95if (messages.Any(m => m.Text is null)) 100if (messages.Any(m => availableRoles.Any(availableRole => availableRole == m.Role) == false))
Microsoft.ML.InternalCodeAnalyzer (2)
InstanceInitializerAnalyzer.cs (1)
72if (!syntax.ChildNodes().Any(s => s.IsKind(SyntaxKind.EqualsValueClause)))
NameAnalyzer.cs (1)
131return modifiers.Any(token => token.IsKind(SyntaxKind.ExternKeyword));
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 (3)
OnnxTransform.cs (3)
555if (!inputShape.Any(x => x == 0)) 610return col => Enumerable.Range(0, _parent.Outputs.Length).Any(i => activeOutput(i)) && _inputColIndices.Any(i => i == col);
Microsoft.ML.Samples (2)
Dynamic\SimpleDataViewImplementation.cs (2)
175=> new Cursor(this, columnsNeeded.Any(c => c.Index == 0), 176columnsNeeded.Any(c => c.Index == 1));
Microsoft.ML.Sweeper (4)
Algorithms\Grid.cs (1)
94return previousRuns.Any(previousRun => previousRun.Equals(paramSet));
Algorithms\NelderMead.cs (3)
167if (previousRuns.Any(runResult => runResult.ParameterSet.Equals(_pendingSweeps[0].Key))) 217if (previousRuns.Any(runResult => runResult.ParameterSet.Equals(_pendingSweeps[0].Key))) 407if (previousRuns.Any(runResult => runResult.ParameterSet.Equals(newParameterSet)))
Microsoft.ML.TensorFlow (2)
TensorflowTransform.cs (2)
781return col => Enumerable.Range(0, _parent.Outputs.Length).Any(i => activeOutput(i)) && _inputColIndices.Any(i => i == col);
Microsoft.ML.TestFramework (2)
BaseTestPredictorsMaml.cs (2)
208if (ctx.Command == Cmd.CV && ctx.ExtraArgs != null && ctx.ExtraArgs.Any(arg => arg.Contains("opf+"))) 244if (removeArgs.Any(x => args[i].StartsWith(x)))
Microsoft.ML.TorchSharp (5)
AutoFormerV2\ObjectDetectionTrainer.cs (1)
987return col => (activeOutput(0) || activeOutput(1) || activeOutput(2)) && _inputColIndices.Any(i => i == col);
NasBert\NerTrainer.cs (1)
439return col => activeOutput(0) && InputColIndices.Any(i => i == col);
NasBert\SentenceSimilarityTrainer.cs (1)
295return col => activeOutput(0) && InputColIndices.Any(i => i == col);
NasBert\TextClassificationTrainer.cs (1)
372return col => (activeOutput(0) || activeOutput(1)) && InputColIndices.Any(i => i == col);
Roberta\QATrainer.cs (1)
941return col => (activeOutput(0) || activeOutput(1)) && _inputColIndices.Any(i => i == col);
Microsoft.ML.Transforms (8)
CustomMappingTransformer.cs (2)
135if (!Enumerable.Range(0, result.Length).Any(activeOutput)) 179if (Enumerable.Range(0, _parent.AddedSchema.Columns.Length).Any(activeOutput))
ExpressionTransformer.cs (1)
982if (activeOutput(i) && _inputColumnIndices[i].Any(index => index == col))
StatefulCustomMappingTransformer.cs (2)
131Func<int, bool> needCol = c => columnsNeeded == null ? false : columnsNeeded.Any(x => x.Index == c); 231Func<int, bool> needCol = c => columnsNeeded == null ? false : columnsNeeded.Any(x => x.Index == c);
Text\NgramHashingTransformer.cs (2)
954Contracts.CheckParam(!inputColumnNames.Any(r => string.IsNullOrWhiteSpace(r)), nameof(inputColumnNames), 1022Contracts.CheckParam(!inputColumnNames.Any(r => string.IsNullOrWhiteSpace(r)), nameof(inputColumnNames),
Text\TextFeaturizingEstimator.cs (1)
414_host.CheckParam(!source.Any(string.IsNullOrWhiteSpace), nameof(source));
Microsoft.ML.Vision (2)
DnnRetrainTransform.cs (2)
949return col => Enumerable.Range(0, _parent._outputs.Length).Any(i => activeOutput(i)) && _inputColIndices.Any(i => i == col);
Microsoft.VisualStudio.LanguageServices (33)
ChangeSignature\ChangeSignatureDialogViewModel.cs (2)
479var canSubmit = AllParameters.Any(p => p.IsRemoved) || 480AllParameters.Any(p => p is AddedParameterViewModel) ||
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (2)
211var containsCSharpProject = solution.Projects.Any(static project => project.Language == LanguageNames.CSharp); 212var containsVisualBasicProject = solution.Projects.Any(static project => project.Language == LanguageNames.VisualBasic);
EditorConfigSettings\SettingsEditorFactory.cs (3)
84if (!_workspace.CurrentSolution.Projects.Any(p => p.Language is LanguageNames.CSharp or LanguageNames.VisualBasic)) 91if (!_workspace.CurrentSolution.Projects.Any(p => p.AnalyzerConfigDocuments.Any(editorconfig => StringComparer.OrdinalIgnoreCase.Equals(editorconfig.FilePath, filePath))))
GenerateType\GenerateTypeDialogViewModel.cs (1)
368if (this.FullFilePath.Split(new[] { '\\' }, StringSplitOptions.RemoveEmptyEntries).Any(s => _reservedKeywords.Contains(s, StringComparer.OrdinalIgnoreCase)))
Implementation\HierarchyItemToProjectIdMap.cs (1)
82if (!candidateProject.DocumentIds.Any(id => ContainedDocument.TryGetContainedDocument(id) != null))
Interactive\VsInteractiveWindowProvider.cs (2)
152c => c.GetType().GetCustomAttributes(typeof(ContentTypeAttribute), inherit: true).Any( 157c => c.GetType().GetCustomAttributes(typeof(ContentTypeAttribute), inherit: true).Any(
Progression\GraphProvider.cs (15)
182if (nodes.Any(n => n.Properties.Any(p => p.Key == DgmlNodeProperties.ContainsChildren)) || 183nodes.Any(n => IsAnySymbolKind(n, SymbolKind.NamedType))) 199if (nodes.Any(n => IsAnySymbolKind(n, SymbolKind.NamedType) && 216if (nodes.Any(n => IsAnySymbolKind(n, SymbolKind.Event, SymbolKind.Method, SymbolKind.Property, SymbolKind.Field))) 226if (nodes.Any(n => IsAnySymbolKind(n, SymbolKind.Event, SymbolKind.Method, SymbolKind.Property) && 244if (nodes.Any(n => IsAnySymbolKind(n, SymbolKind.NamedType) && 256if (nodes.Any(n => IsAnySymbolKind(n, SymbolKind.Event, SymbolKind.Method, SymbolKind.Property) && 260if (nodes.Any(n => CheckAccessibility(n, Accessibility.Public) || 272if (nodes.Any(n => IsAnySymbolKind(n, SymbolKind.NamedType) && 283if (nodes.Any(n => IsAnySymbolKind(n, SymbolKind.Event, SymbolKind.Method, SymbolKind.Property) && 294if (nodes.Any(n => IsAnySymbolKind(n, SymbolKind.Event, SymbolKind.Method, SymbolKind.Property) && 306if (nodes.Any(n => IsAnySymbolKind(n, SymbolKind.Event, SymbolKind.Method, SymbolKind.Property) && 341=> symbolKinds.Any(k => k.Equals(node[RoslynGraphProperties.SymbolKind])); 344=> typeKinds.Any(k => node[RoslynGraphProperties.TypeKind].Equals(k));
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (1)
34!fromProject.ProjectReferences.Any(p => p.ProjectId == _toProjectId))
ProjectSystem\VisualStudioWorkspaceImpl.cs (1)
1590uiContext.IsActive = this.CurrentSolution.Projects.Any(p => p.Language == language);
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (1)
34fromProject.ProjectReferences.Any(p => p.ProjectId == _toProjectId))
StackTraceExplorer\StackTraceExplorerRootViewModel.cs (1)
45=> Tabs.Any(tab => tab.Content.ViewModel.Matches(text));
SyncNamespaces\SyncNamespacesCommandHandler.cs (1)
80.Any(project => project.Language.Equals(LanguageNames.CSharp, StringComparison.OrdinalIgnoreCase));
Venus\ContainedDocument.cs (2)
134if (projectionBuffer.SourceBuffers.Any(b => b.ContentType.IsOfType(Razor) || 142if (projectionBuffer.SourceBuffers.Any(b => b.ContentType.IsOfType(HTML) ||
Microsoft.VisualStudio.LanguageServices.CSharp (1)
LanguageService\CSharpHelpContextService.cs (1)
459return CSharpSyntaxFacts.Instance.GetModifiers(token.Parent).Any(t => t.IsKind(kind));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (12)
Interactive\Commands\ResetInteractiveTests.cs (2)
55Assert.True(replReferenceCommands.Any(rc => rc.EndsWith(@"ResetInteractiveTestsAssembly.dll"""))); 56Assert.True(replReferenceCommands.Any(rc => rc.EndsWith(@"ResetInteractiveVisualBasicSubproject.dll""")));
ProjectSystemShim\CPS\CSharpReferencesTests.cs (8)
62Assert.True(GetProject3ProjectReferences().Any(pr => pr.ProjectId == project1.Id)); 63Assert.True(GetProject3ProjectReferences().Any(pr => pr.ProjectId == project2.Id)); 64Assert.True(GetProject3ProjectReferences().Any(pr => pr.ProjectId == project4.Id)); 65Assert.True(GetProject3MetadataReferences().Any(mr => mr.FilePath == metadaRefFilePath)); 71Assert.True(GetProject3ProjectReferences().Any(pr => pr.ProjectId == project4.Id)); 82Assert.False(GetProject3ProjectReferences().Any(pr => pr.ProjectId == project1.Id)); 83Assert.False(GetProject3ProjectReferences().Any(pr => pr.ProjectId == project2.Id)); 84Assert.False(GetProject3MetadataReferences().Any(mr => mr.FilePath == metadaRefFilePath));
ProjectSystemShim\CPS\SourceFileHandlingTests.cs (2)
38Assert.True(GetCurrentDocuments().Any(s => s.FilePath == sourceFileFullPath)); 56Assert.True(GetCurrentAdditionalDocuments().Any(s => s.FilePath == additionalFileFullPath));
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (1)
77.Where(f => !_secondaryBufferFileExtensions.Any(ext => f.LocalPath.EndsWith(ext)))
MSBuild (5)
BuildEnvironmentHelper.cs (1)
423return processList.Any(s =>
ExceptionHandling.cs (1)
129if (aggregateException.InnerExceptions.Any(innerException => IsCriticalException(innerException)))
FileUtilities.cs (1)
1482if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
LoadedType.cs (2)
53if (CustomAttributeData.GetCustomAttributes(t).Any(attr => attr.AttributeType.Name.Equals(nameof(LoadInSeparateAppDomainAttribute)))) 58if (CustomAttributeData.GetCustomAttributes(t).Any(attr => attr.AttributeType.Name.Equals(nameof(RunInSTAAttribute))))
MSBuildTaskHost (3)
AnsiDetector.cs (1)
45if (terminalsRegexes.Any(regex => regex.IsMatch(termType)))
BuildEnvironmentHelper.cs (1)
423return processList.Any(s =>
FileUtilities.cs (1)
1482if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Mvc.Api.Analyzers.Test (1)
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (1)
37if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))
OpenIdConnectSample (2)
Startup.cs (2)
217if (user == null || !user.Identities.Any(identity => identity.IsAuthenticated)) 229if (context.Request.Path.Equals("/restricted") && !user.Identities.Any(identity => identity.HasClaim("special", "true")))
PresentationFramework (1)
MS\Internal\WindowsRuntime\Generated\WinRT\GuidGenerator.cs (1)
73var isFlags = type.CustomAttributes.Any(cad => cad.AttributeType == typeof(FlagsAttribute));
Qdrant.ApiService (1)
Program.cs (1)
22if (collections.Any(x => x.Contains("movie_collection")))
Roslyn.Test.PdbUtilities (2)
Reader\PdbValidation.cs (2)
489e.Name == "local" && e.Attributes().Any(a => a.Name.LocalName == "name" && a.Value.StartsWith("$VB$ResumableLocal_")) 496where e.Attributes().Any(a => a.Name.LocalName == "format" && a.Value == format)
Roslyn.Test.Performance.Utilities (1)
Benchview.cs (1)
36return s_validSubmissionTypes.Any(type => type == submissionType);
Roslyn.VisualStudio.DiagnosticsWindow (1)
VenusMargin\ProjectionSpanTagger.cs (1)
70.Where(s => spans.Any(ss => ss.IntersectsWith(s)))
SocialSample (2)
Startup.cs (2)
291if (!userResult.Succeeded || user == null || !user.Identities.Any(identity => identity.IsAuthenticated)) 434if (user == null || !user.Identities.Any(identity => identity.IsAuthenticated))
Sockets.BindTests (1)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6ScopeIdPresentConditionAttribute.cs (1)
27.Any(addressInfo => addressInfo.Address.AddressFamily == AddressFamily.InterNetworkV6 && addressInfo.Address.ScopeId != 0);
Sockets.FunctionalTests (1)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6ScopeIdPresentConditionAttribute.cs (1)
27.Any(addressInfo => addressInfo.Address.AddressFamily == AddressFamily.InterNetworkV6 && addressInfo.Address.ScopeId != 0);
System.ComponentModel.Composition (3)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (1)
806if (changedExports.Any(import.IsConstraintSatisfiedBy))
System\ComponentModel\Composition\Hosting\CompositionServices.cs (1)
558return part.ImportDefinitions.Any(import => import.IsRecomposable);
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (1)
351return ExportDefinitions.Any(definition =>
System.Composition.TypedParts (5)
System\Composition\CompositionContextExtensions.cs (1)
82m.CustomAttributes.Any(ca => ca.AttributeType == typeof(OnImportsSatisfiedAttribute)));
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (1)
34where attrs.Any(a => a is ImportAttribute || a is ImportManyAttribute)
System\Composition\TypedParts\ContractHelpers.cs (1)
19if (attributes.Any(a => a is ImportAttribute || a is ImportManyAttribute))
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (1)
236if (_appliedArguments.Any(args => Enumerable.SequenceEqual(args, typeArguments)))
System\Composition\TypedParts\TypedPartExportDescriptorProvider.cs (1)
67if (!forKey.Any(x => x.Metadata.Any()))
System.Linq.Expressions (1)
System\Linq\Expressions\Compiler\StackSpiller.cs (1)
1072if (method != null && method.GetParametersCached().Any(p => p.ParameterType.IsByRef))
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\ClassDataContract.cs (1)
1470return !dataMembers.Any(dm => dm.IsRequired);
System.Private.Windows.Core.TestUtilities (2)
BinarySerialization.cs (2)
28if (!attributes.Any(a => a is SerializableAttribute)) 40if (attributes.Any(a => a is CompilerGeneratedAttribute))
System.Security.Cryptography.Pkcs (1)
System\Security\Cryptography\Pkcs\SignedCms.cs (1)
501else if (_signedData.SignerInfos.Any(si => si.Version == 3))
System.Text.RegularExpressions.Generator (2)
UpgradeToGeneratedRegexCodeFixer.cs (2)
117while (members.Any(m => m.Name == methodName)) 130if (!typeDeclaration.Modifiers.Any(m => m.IsKind(SyntaxKind.PartialKeyword)))
System.Windows.Forms (6)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (2)
346|| _annualBoldDates.Any(d => d.Month == currentDate.Month && d.Day == currentDate.Day) 347|| _monthlyBoldDates.Any(d => d.Day == currentDate.Day);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogPage.cs (4)
769.Any(c => c?.BoundPage is not null)) 815if (_buttons.Any(e => e.IsCreatable && !e.IsStandardButton && IsNativeStringNullOrEmpty(e.Text))) 820if (_radioButtons.Any(e => e.IsCreatable && IsNativeStringNullOrEmpty(e.Text))) 929if (_boundCustomButtons.Any(e => e.IsCreated && e is TaskDialogCommandLinkButton))
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (2)
70.Any(a => a.Name.ToString() == DesignerSerializationVisibilityAttributeName)) 103.Any(u => u?.Name?.ToString() == SystemComponentModelName))
System.Windows.Forms.Design (1)
System\ComponentModel\Design\ExceptionCollection.cs (1)
20if (exceptions.ToArray().Any(e => e is not Exception))
System.Windows.Forms.Design.Tests (1)
System\Windows\Forms\Design\ToolStripContentPanelDesignerTests.cs (1)
43bool containsPaddingSnapLines = snapLines.Any(snapLine => paddingFilters.Contains(snapLine.Filter));
System.Windows.Forms.Primitives.TestUtilities (1)
Extensions\AssertExtensions.cs (1)
219if (exceptionTypes.Any(t => t.Equals(exceptionType)))
System.Windows.Forms.Tests (4)
System\Windows\Forms\AxSystemMonitorTests.cs (2)
63Assert.True(testingControlProps.All(p => assemblyTypeInfo.DeclaredProperties.Any(ap => ap.Name == p))); 64Assert.True(testingControlEvents.All(e => assemblyTypeInfo.DeclaredEvents.Any(ae => ae.Name == e)));
System\Windows\Forms\AxWebBrowserTests.cs (2)
53testingControlProps.All(p => assemblyTypeInfo.DeclaredProperties.Any(ap => ap.Name == p)).Should().BeTrue(); 54testingControlEvents.All(e => assemblyTypeInfo.DeclaredEvents.Any(ae => ae.Name == e)).Should().BeTrue();
Templates.Blazor.Tests (4)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
148.Any(e => string.Equals(oid, e.Oid?.Value, StringComparison.Ordinal));
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
301return hashes.Any(h => string.Equals(h, certificate.Thumbprint, StringComparison.Ordinal));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
123.Any(c => AreCertificatesEqual(c, certificate));
Templates.Blazor.WebAssembly.Auth.Tests (4)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
148.Any(e => string.Equals(oid, e.Oid?.Value, StringComparison.Ordinal));
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
301return hashes.Any(h => string.Equals(h, certificate.Thumbprint, StringComparison.Ordinal));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
123.Any(c => AreCertificatesEqual(c, certificate));
Templates.Blazor.WebAssembly.Tests (4)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
148.Any(e => string.Equals(oid, e.Oid?.Value, StringComparison.Ordinal));
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
301return hashes.Any(h => string.Equals(h, certificate.Thumbprint, StringComparison.Ordinal));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
123.Any(c => AreCertificatesEqual(c, certificate));
Templates.Mvc.Tests (4)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
148.Any(e => string.Equals(oid, e.Oid?.Value, StringComparison.Ordinal));
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
301return hashes.Any(h => string.Equals(h, certificate.Thumbprint, StringComparison.Ordinal));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
123.Any(c => AreCertificatesEqual(c, certificate));
Templates.Tests (4)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (1)
92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
148.Any(e => string.Equals(oid, e.Oid?.Value, StringComparison.Ordinal));
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
301return hashes.Any(h => string.Equals(h, certificate.Thumbprint, StringComparison.Ordinal));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
123.Any(c => AreCertificatesEqual(c, certificate));
WinFormsControlsTest (1)
DragDrop.cs (1)
128else if (files.Length == 1 && files.Any(file => file.Contains("DragAccept.rtf")))
WsFedSample (2)
Startup.cs (2)
98if (user == null || !user.Identities.Any(identity => identity.IsAuthenticated)) 110if (context.Request.Path.Equals("/restricted") && !user.Identities.Any(identity => identity.HasClaim("special", "true")))
xunit.assert (1)
Sdk\AssertHelper.cs (1)
198 type.GetTypeInfo().CustomAttributes.Any(a => a.AttributeType.FullName == "System.Runtime.CompilerServices.CompilerGeneratedAttribute");
xunit.console (2)
CommandLine.cs (1)
473if (TransformFactory.AvailableTransforms.Any(t => t.CommandLine.Equals(optionName, StringComparison.OrdinalIgnoreCase)))
ConsoleRunner.cs (1)
159if (type == null || type.GetTypeInfo().IsAbstract || type == typeof(DefaultRunnerReporter) || type == typeof(DefaultRunnerReporterWithTypes) || !type.GetInterfaces().Any(t => t == typeof(IRunnerReporter)))