99 references to LastOrDefault
Aspire.Hosting (3)
ApplicationModel\ResourceExtensions.cs (2)
22if (resource.Annotations.OfType<T>().LastOrDefault() is { } lastAnnotation) 279if (resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { } imageAnnotation)
ApplicationModel\ResourceNotificationService.cs (1)
485if (resource.Annotations.OfType<ResourceSnapshotAnnotation>().LastOrDefault() is { } annotation)
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
56var sidecarOptionsAnnotation = daprSidecar.Annotations.OfType<DaprSidecarOptionsAnnotation>().LastOrDefault();
ClientSample (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
dotnet-dev-certs (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
dotnet-getdocument (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
dotnet-openapi (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
dotnet-sql-cache (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
dotnet-svcutil-lib (1)
Shared\ProjectPropertyResolver.cs (1)
208var depsFileInfo = depsFiles.OrderBy(f => f.CreationTimeUtc).LastOrDefault();
dotnet-user-jwts (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
dotnet-user-secrets (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
GetDocument.Insider (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
Microsoft.AspNetCore.Authentication.Negotiate (1)
PostConfigureNegotiateOptions.cs (1)
29_serverAuth = serverAuthServices.LastOrDefault();
Microsoft.AspNetCore.Authentication.Test (1)
JwtBearerTests_Handler.cs (1)
1051Assert.Equal(secondKey, Convert.ToBase64String(jwtBearerOptions.TokenValidationParameters.IssuerSigningKeys.OfType<SymmetricSecurityKey>().LastOrDefault()?.Key));
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (1)
316if (!_inVariable || _variables.LastOrDefault() is not HttpRouteVariable variable)
Microsoft.AspNetCore.Grpc.Swagger (1)
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (1)
316if (!_inVariable || _variables.LastOrDefault() is not HttpRouteVariable variable)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\CompileTimeCreationTests.cs (1)
570var log2 = logs.LastOrDefault();
Microsoft.AspNetCore.Identity.UI (1)
IdentityBuilderUIExtensions.cs (1)
72var applicationName = ((IWebHostEnvironment?)environment.LastOrDefault()?.ImplementationInstance)
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
DefaultApiDescriptionProvider.cs (2)
129var acceptsMetadata = action.EndpointMetadata.OfType<IAcceptsMetadata>().LastOrDefault(); 508var endpointGroupName = action.EndpointMetadata.OfType<IEndpointGroupNameMetadata>().LastOrDefault();
Microsoft.AspNetCore.Mvc.Core (1)
Routing\ActionEndpointFactory.cs (1)
388builder.Metadata.OfType<IEndpointNameMetadata>().LastOrDefault()?.EndpointName == null)
Microsoft.AspNetCore.OpenApi (8)
Extensions\JsonNodeSchemaExtensions.cs (1)
317else if (parameterInfo.GetCustomAttributes<DefaultValueAttribute>().LastOrDefault() is { } defaultValueAttribute)
Services\OpenApiDocumentService.cs (5)
298=> description.ActionDescriptor.EndpointMetadata.OfType<IEndpointSummaryMetadata>().LastOrDefault()?.Summary; 301=> description.ActionDescriptor.EndpointMetadata.OfType<IEndpointDescriptionMetadata>().LastOrDefault()?.Description; 305description.ActionDescriptor.EndpointMetadata.OfType<IEndpointNameMetadata>().LastOrDefault()?.EndpointName; 310if (actionDescriptor.EndpointMetadata?.OfType<ITagsMetadata>().LastOrDefault() is { } tagsMetadata) 456parameterInfo.GetCustomAttributes().OfType<DescriptionAttribute>().LastOrDefault() is { } descriptionAttribute ?
Services\Schemas\OpenApiSchemaService.cs (2)
115if (attributeProvider.GetCustomAttributes(inherit: false).OfType<DefaultValueAttribute>().LastOrDefault() is DefaultValueAttribute defaultValueAttribute) 119if (attributeProvider.GetCustomAttributes(inherit: false).OfType<DescriptionAttribute>().LastOrDefault() is DescriptionAttribute descriptionAttribute)
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
Microsoft.AspNetCore.SignalR.Core (1)
Internal\TypedClientBuilder.cs (1)
157bool hasCancellationToken = paramTypes.LastOrDefault() == typeof(CancellationToken);
Microsoft.Build.Engine.UnitTests (1)
Globbing\MSBuildGlob_Tests.cs (1)
33Assert.Equal(glob.TestOnlyGlobRoot.LastOrDefault(), Path.DirectorySeparatorChar);
Microsoft.CodeAnalysis (2)
InternalUtilities\EnumerableExtensions.cs (1)
257return source.Cast<T?>().LastOrDefault();
Syntax\SyntaxTreeExtensions.cs (1)
35node = root.DescendantNodes(n => n.FullSpan.Contains(change)).LastOrDefault();
Microsoft.CodeAnalysis.CodeStyle (2)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
257return source.Cast<T?>().LastOrDefault();
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
35node = root.DescendantNodes(n => n.FullSpan.Contains(change)).LastOrDefault();
Microsoft.CodeAnalysis.CSharp (1)
Syntax\SyntaxFactory.cs (1)
2348var lastNode = compilation.ChildNodes().LastOrDefault();
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
48var previousChar = tokenBeforeParen.Text.LastOrDefault();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
35else if (members.LastOrDefault().Kind() == SyntaxKind.CommaToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
30.LastOrDefault(); 41.LastOrDefault(); 45.LastOrDefault();
Microsoft.CodeAnalysis.CSharp.Features (3)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
276scope = parentExpressions.LastOrDefault()?.Parent ?? scope;
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
346var lastTextToken = textTokens.LastOrDefault();
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1624(editKind == EditKind.Delete ? globalStatements.LastOrDefault() : globalStatements.FirstOrDefault()) ??
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (6)
Syntax\SyntaxNodeTests.cs (6)
2921var m = cu.DescendantNodes().OfType<TypeDeclarationSyntax>().LastOrDefault(); 2937var m = cu.DescendantNodes().OfType<TypeDeclarationSyntax>().LastOrDefault(); 3165var m = cu.DescendantNodes().OfType<ParameterSyntax>().LastOrDefault(); 3205var m = cu.DescendantNodes().OfType<ParameterSyntax>().LastOrDefault(); 3248var m = cu.DescendantNodes().OfType<ParameterSyntax>().LastOrDefault(); 3289var m = cu.DescendantNodes().OfType<ParameterSyntax>().LastOrDefault();
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Rename\CSharpRenameRewriterLanguageService.cs (1)
1249var nodeToSpeculate = node.GetAncestorsOrThis(n => SpeculationAnalyzer.CanSpeculateOnNode(n)).LastOrDefault();
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (1)
56.LastOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
48var previousChar = tokenBeforeParen.Text.LastOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
35else if (members.LastOrDefault().Kind() == SyntaxKind.CommaToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
30.LastOrDefault(); 41.LastOrDefault(); 45.LastOrDefault();
Microsoft.CodeAnalysis.EditorFeatures (2)
CodeActions\IUIThreadOperationContextExtensions.cs (1)
15=> context.Scopes.LastOrDefault().GetCodeAnalysisProgress();
IntelliSense\AsyncCompletion\CommitManager.cs (1)
404if (textTypedSoFar.LastOrDefault() == '\n')
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
Internal\DescriptionService.cs (1)
80builder.LastOrDefault().Tag != TextTags.CodeBlockStart)
Microsoft.CodeAnalysis.Features (3)
ChangeSignature\ParameterConfiguration.cs (1)
39if ((parametersList.LastOrDefault() as ExistingParameter)?.Symbol.IsParams == true)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (1)
145(trivia.HasStructure && fixer.IsEndOfLine(trivia.GetStructure().DescendantTrivia().LastOrDefault()));
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
43.LastOrDefault();
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
FlowAnalysis\FlowTestBase.vb (3)
114Select New With {.first = DirectCast(s, ExecutableStatementSyntax), .last = DirectCast(e, ExecutableStatementSyntax)}).LastOrDefault() 128Select New With {.first = DirectCast(s, ExecutableStatementSyntax), .last = DirectCast(e, ExecutableStatementSyntax)}).LastOrDefault() 136Select DirectCast(s, ExpressionSyntax)).LastOrDefault()
Microsoft.CodeAnalysis.Workspaces (2)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
257return source.Cast<T?>().LastOrDefault();
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
35node = root.DescendantNodes(n => n.FullSpan.Contains(change)).LastOrDefault();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
257return source.Cast<T?>().LastOrDefault();
Microsoft.DotNet.Arcade.Sdk (1)
src\SourceBuild\AddSourceToNuGetConfig.cs (1)
54.LastOrDefault();
Microsoft.DotNet.XUnitExtensions (1)
Discoverers\SkipOnMonoDiscoverer.cs (1)
22if (traitAttribute.GetConstructorArguments().LastOrDefault() is TestPlatforms tp)
Microsoft.Extensions.Hosting.Testing (1)
FakeHostingExtensions.cs (1)
180if (builder.Sources.LastOrDefault() is FakeConfigurationSource source)
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (2)
143=> entryPointSuffix.HasValue && entryPoint.LastOrDefault() == entryPointSuffix.Value 522if (dllImportData.EntryPointName!.LastOrDefault() != entryPointSuffix.Value)
Microsoft.Maui.Controls (1)
Platform\PageExtensions.cs (1)
11 if (currentPage.NavigationProxy.ModalStack.LastOrDefault() is Page modal)
Microsoft.Maui.Essentials (2)
VersionTracking\VersionTracking.shared.cs (2)
210 string LastInstalledVersion => versionTrail[versionsKey]?.LastOrDefault() ?? string.Empty; 212 string LastInstalledBuild => versionTrail[buildsKey]?.LastOrDefault() ?? string.Empty;
Microsoft.ML.Data (4)
Data\SchemaDefinition.cs (1)
236internal Type ReturnType => Generator?.GetMethodInfo().GetParameters().LastOrDefault().ParameterType.GetElementType();
DataLoadSave\EstimatorChain.cs (1)
39LastEstimator = estimators.LastOrDefault() as IEstimator<TLastTransformer>;
DataLoadSave\TransformerChain.cs (1)
91LastTransformer = transformers.LastOrDefault() as TLastTransformer;
Evaluators\Metrics\MulticlassClassificationMetrics.cs (1)
80public double TopKAccuracy => TopKAccuracyForAllK?.LastOrDefault() ?? 0;
Microsoft.VisualBasic.Tests (1)
Microsoft\VisualBasic\ApplicationServices\ApplicationBaseTests.cs (1)
58string key = GetEnvironmentVariables().LastOrDefault().Item1 ?? "";
Microsoft.VisualStudio.LanguageServices (3)
ChangeSignature\ChangeSignatureDialogViewModel.ParameterViewModels.cs (2)
79if (this == ChangeSignatureDialogViewModel._parametersWithoutDefaultValues.LastOrDefault() && 85if (this == ChangeSignatureDialogViewModel._parametersWithDefaultValues.LastOrDefault() &&
SymbolSearch\VisualStudioSymbolSearchService.cs (1)
188var bestRank = packagesUsedInOtherProjects.LastOrDefault()?.Rank;
Mvc.RoutingWebSite (1)
StartupForDynamicOrder.cs (1)
91var kvps = ((string)values?["slug"])?.Split("/")?.LastOrDefault()?.Split(",") ?? Array.Empty<string>();
Swaggatherer (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
System.Collections.Immutable (1)
System\Linq\ImmutableArrayExtensions.cs (1)
432return immutableArray.array!.LastOrDefault()!;
System.Linq.Parallel (1)
System\Linq\ParallelEnumerable.cs (1)
5671return ExceptionAggregator.WrapEnumerable(childWithCancelChecks, settings.CancellationState).LastOrDefault();
System.Windows.Forms.Tests (2)
System\Windows\Forms\TreeNodeTests.cs (2)
119Assert.Same(children.LastOrDefault(), node.LastNode); 210Assert.Same(children.LastOrDefault(), node.LastNode);
Templates.Blazor.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
Templates.Mvc.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
Templates.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();
Wasm.Performance.ConsoleHost (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
117var lastArg = Arguments.LastOrDefault();