132 references to FirstOrDefault
ConfigurationSchemaGenerator (3)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (3)
674AttributeData? attributeData = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, _typeSymbols.ConfigurationKeyNameAttribute)); 807return type.AllInterfaces.FirstOrDefault(candidate => 813return type.AllInterfaces.FirstOrDefault(candidate => SymbolEqualityComparer.Default.Equals(candidate, @interface));
ILLink.RoslynAnalyzer (1)
RequiresAnalyzerBase.cs (1)
280 var url = requiresAttribute?.NamedArguments.FirstOrDefault (na => na.Key == "Url").Value.Value?.ToString ();
Microsoft.Analyzers.Local (1)
ApiLifecycle\ModelLoader.cs (1)
26var assemblyBaselineFile = files.FirstOrDefault(file =>
Microsoft.AspNetCore.App.Analyzers (7)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (2)
413var parameter = parameters.FirstOrDefault(p => p.Name == name); 493var parameter = parameters.FirstOrDefault(p => p.Name == name);
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (2)
278var delegateParameter = method.Parameters.FirstOrDefault(p => delegateSymbol.IsAssignableFrom(p.Type)); 291var routeStringParameter = method.Parameters.FirstOrDefault(p => SymbolEqualityComparer.Default.Equals(stringSymbol, p.Type) &&
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
134var parameterSymbol = resolvedParameterSymbols.FirstOrDefault(s => string.Equals(s.RouteParameterName, routeParameter.Name, StringComparison.OrdinalIgnoreCase));
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (1)
92var resolvedParameter = routeUsage.UsageContext.ResolvedParameters.FirstOrDefault(rp => rp.Symbol.Name == handlerDelegateParameter.Name);
src\Shared\RoslynUtils\ParsabilityHelper.cs (1)
127var constructedTypeSymbol = typeSymbol.AllInterfaces.FirstOrDefault(
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentFacts.cs (1)
58var attribute = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute));
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentFacts.cs (1)
58var attribute = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute));
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
src\Shared\RoslynUtils\ParsabilityHelper.cs (1)
127var constructedTypeSymbol = typeSymbol.AllInterfaces.FirstOrDefault(
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
SymbolApiResponseMetadataProvider.cs (1)
111.FirstOrDefault(m => m.Kind == SymbolKind.Method && m.IsStatic && m.DeclaredAccessibility == Accessibility.Public);
Microsoft.Build.BuildCheck.UnitTests (2)
EditorConfigParser_Tests.cs (2)
135var csSection = result.NamedSections.FirstOrDefault(s => s.Name == "*.cs"); 141var mdSection = result.NamedSections.FirstOrDefault(s => s.Name == "*.md");
Microsoft.CodeAnalysis (7)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (5)
203singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Namespace); 217singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Event); 221singleResult = candidateMembers.FirstOrDefault(s => 823return (INamedTypeSymbol)candidateMembers.FirstOrDefault(s => 831.FirstOrDefault(s =>
InternalUtilities\OneOrMany.cs (1)
149return _many.FirstOrDefault(predicate);
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
57var assemblyScopedNamespaceSymbol = namespaceSymbol.ConstituentNamespaces.FirstOrDefault(ns => ns.ContainingAssembly == assemblyToScope);
Microsoft.CodeAnalysis.CodeStyle (10)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
101var ienumerableOfT = collectionType.AllInterfaces.FirstOrDefault(i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
563var fadingLocation = member.DeclaringSyntaxReferences.FirstOrDefault(
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (5)
203singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Namespace); 217singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Event); 221singleResult = candidateMembers.FirstOrDefault(s => 823return (INamedTypeSymbol)candidateMembers.FirstOrDefault(s => 831.FirstOrDefault(s =>
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
149return _many.FirstOrDefault(predicate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (2)
1124var parameter1 = signature1Parameters.FirstOrDefault(p => p.Name == name); 1127var parameter2 = signature2Parameters.FirstOrDefault(p => p.Name == name);
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (1)
44var unimplementedDefaultConstructor = state.UnimplementedConstructors.FirstOrDefault(
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
96var baseNoArgConstructor = baseType.Constructors.FirstOrDefault(c => c.Parameters.Length == 0);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
322constraints.FirstOrDefault(t => t.IsReferenceType);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
133.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnType: var returnType, Parameters.Length: 0 } && 149.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnsVoid: true, Parameters.Length: 0 }) is IMethodSymbol disposeMethodFromPattern)
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\LocalDataFlowPass.cs (1)
174var restField = containingType.GetMembers(NamedTypeSymbol.ValueTupleRestFieldName).FirstOrDefault(s => s is not TupleVirtualElementFieldSymbol) as FieldSymbol;
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
103: convertedType.AllInterfaces.FirstOrDefault(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
379var constructor = constructors.FirstOrDefault(c => !c.IsStatic && predicate(c));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
52primaryConstructor = typeSymbol.InstanceConstructors.FirstOrDefault(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1462var argument = invocationOperation.Arguments.FirstOrDefault(a => Equals(originalParameter, a.Parameter));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
239var argumentOp = invocationOp.Arguments.FirstOrDefault(a => a.Syntax == argument);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
71return containingType.Interfaces.FirstOrDefault(iface => iface.Equals(equatable)); 314var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
175var orderedKVPs = properties.OrderBy(kvp => constructor.Parameters.FirstOrDefault(p => p.Name == kvp.Value)?.Ordinal);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (1)
182var description = info?.Sections.FirstOrDefault(s => s.Kind == QuickInfoSectionKinds.Description);
Microsoft.CodeAnalysis.CSharp.Features (5)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
103: convertedType.AllInterfaces.FirstOrDefault(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
379var constructor = constructors.FirstOrDefault(c => !c.IsStatic && predicate(c));
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
71return containingType.Interfaces.FirstOrDefault(iface => iface.Equals(equatable)); 314var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
175var orderedKVPs = properties.OrderBy(kvp => constructor.Parameters.FirstOrDefault(p => p.Name == kvp.Value)?.Ordinal);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Rename\CSharpRenameRewriterLanguageService.cs (1)
146_renamableDeclarationLocation = _renamedSymbol.Locations.FirstOrDefault(loc => loc.IsInSource && loc.SourceTree == _semanticModel.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
52primaryConstructor = typeSymbol.InstanceConstructors.FirstOrDefault(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1462var argument = invocationOperation.Arguments.FirstOrDefault(a => Equals(originalParameter, a.Parameter));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
239var argumentOp = invocationOp.Arguments.FirstOrDefault(a => a.Syntax == argument);
Microsoft.CodeAnalysis.EditorFeatures (1)
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
360var firstDocumentReplacements = documentReplacements.FirstOrDefault(d => !d.Item2.IsEmpty);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
QuickInfo\AbstractSemanticQuickInfoSourceTests.cs (1)
55var textBlock = sections.FirstOrDefault(tb => tb.Kind == textBlockKind);
Microsoft.CodeAnalysis.Features (28)
ChangeSignature\AbstractChangeSignatureService.cs (1)
617var match = originalParameters.FirstOrDefault(p => p.Name == name);
Completion\CompletionService.ProviderManager.cs (1)
163return GetCachedProjectCompletionProvidersOrQueueLoadInBackground(project, CompletionOptions.Default).FirstOrDefault(isNameMatchingProviderPredicate);
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
38var from = fromNodes.FirstOrDefault(n => n.RawKind == FromKind);
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (2)
274var param1 = invocationSymbol.Parameters.FirstOrDefault(p => syntaxFacts.StringComparer.Equals(p.Name, arg1Name)); 275var param2 = invocationSymbol.Parameters.FirstOrDefault(p => syntaxFacts.StringComparer.Equals(p.Name, arg2Name));
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
320var attribute = type.GetAttributes().FirstOrDefault(d => IsDesignerAttribute(d.AttributeClass));
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
176var iformattable = type.AllInterfaces.FirstOrDefault(t => t is
Emit\CompilationOutputFilesWithImplicitPdbPath.cs (2)
57var embeddedPdbEntry = debugDirectory.FirstOrDefault(e => e.Type == DebugDirectoryEntryType.EmbeddedPortablePdb); 63var codeViewEntry = debugDirectory.FirstOrDefault(e => e.Type == DebugDirectoryEntryType.CodeView);
Emit\CompilationOutputs.cs (1)
110var embeddedPdbEntry = peReader.ReadDebugDirectory().FirstOrDefault(e => e.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);
ExtractMethod\MethodExtractor.Analyzer.cs (1)
117var thisParameterBeingRead = (IParameterSymbol?)dataFlowAnalysisData.ReadInside.FirstOrDefault(IsThisParameter);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (1)
117=> containingType.InstanceConstructors.FirstOrDefault(c => MatchesConstructorBasedOnParameterTypes(c, parameters));
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
155var delegatedConstructor = _state.BaseTypeOrInterfaceOpt.InstanceConstructors.FirstOrDefault(
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
50var argument = potentialArguments.FirstOrDefault(n => n?.Parent is TTupleExpressionSyntax);
NavigationBar\AbstractNavigationBarItemService.cs (2)
67var navigationLocationSpan = symbol.Locations.FirstOrDefault(loc => loc.SourceTree == tree)?.SourceSpan ?? 79var navigationLocation = symbol.Locations.FirstOrDefault(loc => loc.SourceTree != null && loc.SourceTree != tree) ??
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
95var childMember = namedType.GetMembers().FirstOrDefault(m => syntaxFacts.StringComparer.Equals(m.Name, singleWordText));
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
101var ienumerableOfT = collectionType.AllInterfaces.FirstOrDefault(i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
563var fadingLocation = member.DeclaringSyntaxReferences.FirstOrDefault(
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (1)
44var unimplementedDefaultConstructor = state.UnimplementedConstructors.FirstOrDefault(
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
96var baseNoArgConstructor = baseType.Constructors.FirstOrDefault(c => c.Parameters.Length == 0);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
322constraints.FirstOrDefault(t => t.IsReferenceType);
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
57var assemblyScopedNamespaceSymbol = namespaceSymbol.ConstituentNamespaces.FirstOrDefault(ns => ns.ContainingAssembly == assemblyToScope);
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (5)
203singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Namespace); 217singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Event); 221singleResult = candidateMembers.FirstOrDefault(s => 823return (INamedTypeSymbol)candidateMembers.FirstOrDefault(s => 831.FirstOrDefault(s =>
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Extensions\Extensions.cs (1)
132var matchingItem = items.FirstOrDefault(d => projectIdGetter(d) == projectId);
Microsoft.CodeAnalysis.Test.Utilities (1)
Compilation\IRuntimeEnvironment.cs (1)
57DebugDirectoryEntry portablePdbEntry = peReader.ReadDebugDirectory().FirstOrDefault(e => e.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);
Microsoft.CodeAnalysis.Workspaces (17)
Editing\SyntaxGenerator.cs (1)
527var invoke = symbol.Type.GetMembers("Invoke").FirstOrDefault(m => m.Kind == SymbolKind.Method) as IMethodSymbol;
FindSymbols\SymbolFinder.cs (1)
235linkedSymbol = linkedNamedType.Constructors.FirstOrDefault(
Recommendations\AbstractRecommendationServiceRunner.cs (2)
242parameterType = method.Parameters.FirstOrDefault(p => _stringComparerForLanguage.Equals(p.Name, argumentName))?.Type; 321.FirstOrDefault(s => s is INamedTypeSymbol namedType && namedType.SpecialType == specialType);
Rename\IRenameRewriterLanguageService.cs (1)
143var conflictingParameter = prop.Parameters.FirstOrDefault(
Shared\Extensions\ITypeSymbolExtensions.cs (1)
97constructedInterface.GetMembers(interfaceMember.Name).FirstOrDefault(
Shared\Extensions\ProjectExtensions.cs (1)
32=> project.Solution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(id => id.ProjectId == project.Id);
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
149return _many.FirstOrDefault(predicate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (2)
1124var parameter1 = signature1Parameters.FirstOrDefault(p => p.Name == name); 1127var parameter2 = signature2Parameters.FirstOrDefault(p => p.Name == name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (5)
174var fallbackNode = contextSpine.FirstOrDefault(HasAnyImports); 188externContainer = contextSpine.FirstOrDefault(HasExterns) ?? fallbackNode; 189usingContainer = contextSpine.FirstOrDefault(HasUsings) ?? fallbackNode; 190staticUsingContainer = contextSpine.FirstOrDefault(HasStaticUsings) ?? fallbackNode; 191aliasContainer = contextSpine.FirstOrDefault(HasAliases) ?? fallbackNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
133.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnType: var returnType, Parameters.Length: 0 } && 149.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnsVoid: true, Parameters.Length: 0 }) is IMethodSymbol disposeMethodFromPattern)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
149return _many.FirstOrDefault(predicate);
Microsoft.DotNet.CodeAnalysis (3)
Analyzers\BaseAnalyzer.cs (1)
23var configFile = context.Options.AdditionalFiles.FirstOrDefault(file => file.Path.Contains(ConfigFileName));
Analyzers\PinvokeAnalyzer.cs (2)
30_allowedPinvokeFile = obj.Options.AdditionalFiles.FirstOrDefault(f => Path.GetFileName(f.Path).IndexOf("PinvokeAnalyzer_", StringComparison.OrdinalIgnoreCase) >= 0); 31_exceptionFile = obj.Options.AdditionalFiles.FirstOrDefault(f => Path.GetFileName(f.Path).IndexOf("PinvokeAnalyzerExceptionList.analyzerdata", StringComparison.OrdinalIgnoreCase) >= 0);
Microsoft.Interop.ComInterfaceGenerator (4)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
51AttributeData? interfaceTypeAttributeData = type.GetAttributes().FirstOrDefault(a => a.AttributeClass.Equals(interfaceTypeAttribute, SymbolEqualityComparer.Default));
ComClassInfo.cs (1)
45AttributeData? generatedComInterfaceAttribute = iface.GetAttributes().FirstOrDefault(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.GeneratedComInterfaceAttribute);
ComInterfaceGenerator.cs (1)
340TypePositionInfo? managedReturnInfo = signatureContext.ElementTypeInformation.FirstOrDefault(e => e.IsManagedReturnPosition);
VtableIndexStubGenerator.cs (1)
300var unmanagedObjectUnwrapper = symbol.ContainingType.GetAttributes().FirstOrDefault(att => att.AttributeClass.IsOfType(TypeNames.UnmanagedObjectUnwrapperAttribute));
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSExportCodeGenerator.cs (1)
56IBoundMarshallingGenerator spanArg = _marshallers.SignatureMarshallers.FirstOrDefault(m => m.TypeInfo.MarshallingAttributeInfo is JSMarshallingInfo(_, JSSpanTypeInfo));
JSImportCodeGenerator.cs (1)
63IBoundMarshallingGenerator spanArg = _marshallers.SignatureMarshallers.FirstOrDefault(m => m.TypeInfo.MarshallingAttributeInfo is JSMarshallingInfo(_, JSSpanTypeInfo));
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\ConvertToLibraryImportAnalyzer.cs (2)
186AttributeData? bestFitMappingContainingType = method.ContainingType.GetAttributes().FirstOrDefault(attr => attr.AttributeClass.ToDisplayString() == TypeNames.System_Runtime_InteropServices_BestFitMappingAttribute); 192AttributeData? bestFitMappingContainingAssembly = method.ContainingAssembly.GetAttributes().FirstOrDefault(attr => attr.AttributeClass.ToDisplayString() == TypeNames.System_Runtime_InteropServices_BestFitMappingAttribute);
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
60AttributeData? attrData = containingType.GetAttributes().FirstOrDefault(
Microsoft.Maui.Controls.BindingSourceGen (1)
ISymbolExtensions.cs (1)
53 return symbol.GetAttributes().FirstOrDefault(attr => attr.AttributeClass?.Name == attributeName);
Microsoft.ML.InternalCodeAnalyzer (4)
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
62var attribute = context.Symbol.GetAttributes().FirstOrDefault(a => Equals(a.AttributeClass, attributeType));
ContractsCheckNameofFixProvider.cs (3)
36var diagnostic = context.Diagnostics.FirstOrDefault(d => d.Id == Id); 143AttributeData attr = s.GetAttributes().FirstOrDefault(a => a.AttributeClass.Name == "ArgumentAttribute"); 152var shortPair = attr.NamedArguments.FirstOrDefault(p => p.Key == "ShortName");
Microsoft.VisualStudio.LanguageServices (4)
MoveStaticMembers\MoveStaticMembersDialogViewModel.cs (1)
77var foundItem = AvailableTypes.FirstOrDefault(t => t.FullyQualifiedTypeName == SearchText);
Progression\GraphBuilder.cs (2)
200var preferredLocation = symbol.Locations.FirstOrDefault(l => l.SourceTree != null); 207preferredLocation = symbol.Locations.FirstOrDefault(l => l.SourceTree == syntaxTree) ?? preferredLocation;
Venus\ContainedLanguageCodeSupport.cs (1)
491var typeLocation = type.Locations.FirstOrDefault(d => d.SourceTree == containingTree);
System.Reflection.Metadata (2)
System\Reflection\PortableExecutable\PEReader.cs (2)
741var codeViewEntry = ImmutableArrayExtensions.FirstOrDefault(entries, e => e.IsPortableCodeView); 749var embeddedPdbEntry = ImmutableArrayExtensions.FirstOrDefault(entries, e => e.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);